How to run Simulink Model File From Script file ?
古いコメントを表示
I have a GUI where I choose a file to be simulated using a browse Option(Push Button), Am not able to simulate the file which I choose using the codes but if I specifically write the code like sim ('test_new01') am able to simulate. But when its sim('filename') am not able to simulate the file (that line code because name changes every time I choose different model file)
回答 (2 件)
KL
2017 年 5 月 23 日
save the return in a cell array and use it.
filename{1,1} = get(handles.edit1,'String');
sim(filename{1,1});
3 件のコメント
Nithesh Nayak
2017 年 5 月 23 日
KL
2017 年 5 月 23 日
in your case,
sim([pathname filename]);
Nithesh Nayak
2017 年 5 月 24 日
Nithesh Nayak
2018 年 6 月 5 日
編集済み: Nithesh Nayak
2018 年 6 月 5 日
カテゴリ
ヘルプ センター および File Exchange で Model, Block, and Port Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!