connecting simulink with matlab
이전 댓글 표시
Hello
I want to know how to run a simulink model in the middle of my code in the matlab, so if I have a matlab code and in the middle of the code I want to write a command that runs the simulink model and then continue with the normal code.
assume the simulink model name is "mymodel"
답변 (1개)
Fangjun Jiang
2020년 1월 27일
0 개 추천
results=sim('mymodel')
댓글 수: 8
ahmed abdelmgeed
2020년 1월 27일
Fangjun Jiang
2020년 1월 27일
Yes. It could also be done by adding a line
open_system('mymodel')
ahmed abdelmgeed
2020년 1월 27일
Fangjun Jiang
2020년 1월 27일
There is no upload. in MATLAB, run
open_system('mymodel')
results=sim('mymodel')
Of couse, make sure your model file is in current directory or in the MATLAB path.
ahmed abdelmgeed
2020년 1월 27일
ahmed abdelmgeed
2020년 1월 27일
Fangjun Jiang
2020년 1월 27일
You need to learn some basics of Simulink. It's a simulation program. Those 51values correspond to the 51 time instances of the simulation. At time=0s, the value is 10. At time=0.2s, the value is 10, ..., etc.
ahmed abdelmgeed
2020년 1월 27일
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

