changing the simulation time in simulink through script
显示 更早的评论
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 个评论
Jonathan Epperl
2012-12-11
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
2012-12-11
Jonathan Epperl
2012-12-11
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
2012-12-11
Jonathan Epperl
2012-12-11
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
2012-12-11
Why are you updating stop time? what is the aim?
Walter Roberson
2012-12-11
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
2012-12-11
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
2012-12-11
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!