simscapeで作​成したモデルをコマン​ドから1ステップずつ​実行する方法について

simscapeで作成したモデルをコマンドから開き1ステップずつ進める方法がありましたら教えていただきたいです。よろしくお願いいたします。

 Respuesta aceptada

covao
covao el 6 de Jul. de 2024

0 votos

SimscapeやSimulinkのモデルは、MATLABコマンドでステップ実行することができます。
Simulinkの実行コマンドは以下に情報があります。
以下は、Simulinkモデルをステップ実行するスクリプト例です。
コードの作成に生成AIを用いています。
% Open the model
openExample('simulink_general/sldemo_bounceExample')
% Start the simulation
set_param(bdroot, 'SimulationCommand', 'start');
set_param(bdroot, 'SimulationCommand', 'pause');
% Advance one step
set_param(bdroot, 'SimulationCommand', 'step');
% % Advance multiple steps as needed
for i = 1:5
set_param(bdroot, 'SimulationCommand', 'step');
pause(1); % Pause for 1 second
end
% Stop the simulation
set_param(bdroot, 'SimulationCommand', 'stop');

1 comentario

松
el 17 de Jul. de 2024
ありがとうございます.使用させていただきます.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simscape Multibody en Centro de ayuda y File Exchange.

Productos

Versión

R2024a

Etiquetas

Preguntada:

松
el 2 de Jul. de 2024

Comentada:

松
el 17 de Jul. de 2024

Community Treasure Hunt

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

Start Hunting!