How to stop/delay execution for specified time

I want my MATLAB script to wait for 1 second and continue its execution,,,how to perform it,,,,,for i=1:1:3; set_param('course_speed_position','StartTime','1', 'StopTime', 'i')
simOut = sim( 'C:\Documents and Settings\admin\Desktop\New Folder (5)\02_12_2012(Simulink blocks)\Resolved Models\Speed+Position+Course\course_speed_position.mdl');
end,,In this i wnat to wait my for loop for 1 second and take the next for value

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 6 de Dic. de 2012
pause(1)

6 comentarios

Sean de Wolski
Sean de Wolski el 6 de Dic. de 2012
Welcome back Fangjun!
Matt Fig
Matt Fig el 6 de Dic. de 2012
^+1
Fangjun Jiang
Fangjun Jiang el 6 de Dic. de 2012
Thanks, Guys! Have a good holiday season!
Image Analyst
Image Analyst el 6 de Dic. de 2012
Yes welcome back, but you might want to find a different place to park your car.
Thank u,,,
In simulink model, how will we give a simulation time interval in between, while the simulation is running from 0 to 5 sec. Is there any code syntax for this ?
For e.g. :- Let's say, when we start the simulation from 0 sec to 5 sec, the data is processed (input data is given to a system and output data is generated) from 0 sec to 0.05 sec time, then there is an interval from 0.05 sec to 0.06 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and again the data processing goes on (input data is given to a system and output data is generated) from 0.06 sec to 0.11 sec, then again there is interval at 0.11 sec to 0.12 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), again from 0.12 sec to 0.17 sec the data processing goes on (input data is given to a system and output data is generated), from 0.17 sec to 0.18 sec, there is an interval (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and like that, this process goes on till 5 sec simulation time.
So, is there any code syntax for providing this time interval ? Atleast give me some suggestion. I am not asking for an exact answer.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre General Applications en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by