Simulink Post Sim Function
이전 댓글 표시
Hello Friends,
is there any way to kick start a custom function post simulation ?
What i want to do is i am changing a block paramter in init function ,after simultion i want to change the block paramter again to original
i am unable to do it in StopFcn.I am using matlab 2016b
Thanks in advance
답변 (1개)
Fangjun Jiang
2020년 6월 10일
편집: Fangjun Jiang
2020년 6월 12일
0 개 추천
Try the PostSaveFcn.
댓글 수: 12
Ajay krishna Vasanthakumar
2020년 6월 12일
Fangjun Jiang
2020년 6월 12일
Why "i am unable to do it in StopFcn"? StopFcn is ran after the simulation stops.
Ajay krishna Vasanthakumar
2020년 6월 15일
Fangjun Jiang
2020년 6월 15일
I am curious. What parameter?
Ajay krishna Vasanthakumar
2020년 6월 15일
Fangjun Jiang
2020년 6월 15일
You are right. It is odd that Simulink complaints "Cannot change number of ports while simulation is running" but the callback is "StopFcn". It is meant to run the command "after" the simulation stops.
Make an example and send a request to the Mathworks tech support. Ask their explaination why you can change other block parameters but not this one in "StopFcn". You can certainly do this using a separate script. Ask if they have a solution if you have to use a callback.
Ajay krishna Vasanthakumar
2020년 6월 15일
Fangjun Jiang
2020년 6월 15일
So, were you able to acomplish this task using setpostsimfcn?
Ajay krishna Vasanthakumar
2020년 6월 15일
Ajay krishna Vasanthakumar
2020년 6월 19일
Fangjun Jiang
2020년 6월 19일
No. Never used this property. I tried it in R2016b. It didn't do what you are expecting.
Ajay krishna Vasanthakumar
2020년 6월 20일
카테고리
도움말 센터 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!