changing the simulation time in simulink through script
Show older comments
I am controlling my simulink models through MATLAB Script ,and am updating stop time through script,,,The problem here am getting is if i change any parameters value of the simulink while simulink is running,,the simulation calculation is con sidering the changed values from the initial step of the simulation,,,but rather i want my simulation to consider the new parameter value value from the step i chanf=ged while simulation is running
9 Comments
Jonathan Epperl
on 11 Dec 2012
Are you saying you want to change the stop time of a Simulink model while it is running? I'd be very surprised if that was possible.
Arun Badigannavar
on 11 Dec 2012
Jonathan Epperl
on 11 Dec 2012
So what you want to do is changing the initial state, initial time and final time so you can simulate over a longer interval in smaller steps? If so, then you can do that with the sim command, e.g.
sim('untitled','StartTime','2','StopTime','10')
starts untitled at t=2, runs it till t=10. The syntax looks weird to me, it might have changed from older Simulink/Matlab versions. Try
doc sim
Arun Badigannavar
on 11 Dec 2012
Jonathan Epperl
on 11 Dec 2012
You will have to give it a better try of explaining, since I clearly don't get what your problem is.
What parameters of what blocks do you change, and what are the "values from the starting?"
Azzi Abdelmalek
on 11 Dec 2012
Why are you updating stop time? what is the aim?
Walter Roberson
on 11 Dec 2012
Arun wants to run for a while with one set of parameters, then adjust the parameters by code, then resume running from that point but with the new set of parameters and without having the simulation restart.
Vishal Rane
on 11 Dec 2012
I guess this is want Arun is trying to say:
He wants to and is able to update certain parameters while the simulation is in progress, suppose at T=500.
But the simulation result indicates that Simulink ran the entire simulation based on the updated parameters only, while he expected both the previous (T=0 to 500) and the updated parameters (T=500 to end) to have a bearing on the result.
Arun Badigannavar
on 11 Dec 2012
Accepted Answer
More Answers (0)
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!