Using open_system( ) with specific matlab version

I have a batch script that opens a simulink model:
matlab -r "set(0, 'RecursionLimit', 2000); open_system('file.slx')"
I have been using this script for a model using matlab 2018b. I have had to install 2021 matlab for another project i'm working on and when I try run this batch file it now always opens in 2021. Is there a way to run this batch file and open "file.slx" in matlab 2018b when I have a newer version installed?

2 件のコメント

Voss
Voss 2021 年 12 月 20 日
Try replacing "matlab" there with the full path of the 2018b exe, e.g.:
"C:\Program Files\MATLAB\R2018b\bin\matlab.exe" -r "set(0, 'RecursionLimit', 2000); open_system('file.slx')"
Dylan
Dylan 2021 年 12 月 20 日
This worked thanks!

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2018b

タグ

質問済み:

2021 年 12 月 20 日

コメント済み:

2021 年 12 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by