set parameter value from mfile
조회 수: 2 (최근 30일)
이전 댓글 표시
how to set values on different periods of time in simulink from m file? during simulation , for example if i use this command set_param('modelname/variable','value',' ');
댓글 수: 1
Walter Roberson
2012년 11월 5일
Please use better tags for this Question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
답변 (3개)
Azzi Abdelmalek
2012년 11월 3일
편집: Azzi Abdelmalek
2012년 11월 4일
You must stop or pause simultion before seting new parameters
댓글 수: 0
Raju Purohit
2012년 11월 4일
There are several ways.
- You can pause the simulation at any instant and go to the particular block parameters and change the values and play the simulation again. But you have to tolerate the pain of pausing the simulation at stipulated times and running again each time you have to change parameters. This is the easiest though. This doesn't use m file.
- Otherwise if your parameters are to be changed and you know the parameter values and time intervals beforehand, you can code them in Embedded MATLAB Function block. (Don't forget to include "eml.extrinsic('set_param');" in this block).
- Or (the best method) you can create a GUI if you are required to change the parameters continuously without pausing the simulation and when you don't know the time and parameter values beforehand. This is more versatile and less painful. You will have to code the GUI m file.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!