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

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

 채택된 답변

covao
covao 2024년 7월 6일

0 개 추천

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

松
2024년 7월 17일
ありがとうございます.使用させていただきます.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simscape Multibody에 대해 자세히 알아보기

제품

릴리스

R2024a

태그

질문:

松
2024년 7월 2일

댓글:

松
2024년 7월 17일

Community Treasure Hunt

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

Start Hunting!