Simulink モデルを MATLAB ファイルやコマンドラインから起動し、実行するにはどうすればよいですか?
96 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 25 de Oct. de 2013
Respondida: MathWorks Support Team
el 25 de Oct. de 2013
Simulink モデルを MATLAB ファイルやコマンドラインから起動し、実行する方法を教えてください。
Respuesta aceptada
MathWorks Support Team
el 25 de Oct. de 2013
以下に MATLAB ファイルまたはコマンドラインから Simulink モデルを起動、実行するコマンドを紹介します。
- Simulinkモデルを起動
open_system('モデル名')
- Simulinkモデルを実行
sim('モデル名')
または
set_param('モデル名','SimulationCommand','start')
※注意
SIM 関数は、シミュレーション終了時間まで実行され、その間は他のコマンドを実行することはできません。シミュレーション時間が有限時間の場合に有効な関数です。
SET_PARAM 関数を用いる場合、シミュレーション実行の間も他のコマンドを実行することができます。シミュレーション時間が無限時間の場合に有効な関数です。例えば、シミュレーションを10秒間実行し自動的に停止させる場合は、次のようなスクリプトで実現することが可能です。
set_param('モデル名','SimulationCommand','start')
pause(10);
set_param('モデル名','SimulationCommand','stop')
なお、”モデルの更新”は下記になります。
set_param('モデル名', 'SimulationCommand', 'update')
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!