Borrar filtros
Borrar filtros

Synchronise real time to simulation time

1 visualización (últimos 30 días)
Arjun
Arjun el 9 de Oct. de 2014
Respondida: Iain el 9 de Oct. de 2014
I have a Simulink model and its Fixed-step size is 0.05(50ms) and i wanted to determine if this siulation runs exactly at 50ms with respect to real time 50ms . If not i wanted to determine the real time it takes if i run the model for 10 second in MATLAB time.

Respuestas (1)

Iain
Iain el 9 de Oct. de 2014
If you use the "sim" command to run a simulink model, via matlab code, you can use tic & toc to measure how long it took to complete.
tic;
sim(... ) % make sure the inputs are right for what you want.
toc
Alternatively, there are the "clock" and "now" matlab functions. I expect that you'll be able to put them into the model via embedded matlab (though, this will slow the simulation down)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by