フィルターのクリア

Build physical model in matlab command line

2 ビュー (過去 30 日間)
Qi
Qi 2013 年 5 月 3 日
回答済み: Steve Miller 2023 年 4 月 22 日
I'm wondering if it is possible to build up a physical model in Matlab command line instead of using the interactive way in simscape.
I found similar idea is achievable for simulink by proporly utilizing the Matlab command "add_block" and "add_line". So, it looks quite straightforward to try the following codes in command window.
>> simscape;
>> open_system('ssc_dc_motor_thermal_circuit');
>> add_block('simscape/Foundation Library/Thermal/Thermal Elements/Thermal Reference', 'ssc_dc_motor_thermal_circuit/Thermal Reference');
where "ssc_dc_motor_thermal_circuit" is just a demo simulation randomly picked up for trial.
Yet, the code gave an error saying "There is no block named 'simscape/Foundation Library/Thermal/Thermal Elements/Thermal Reference'".
Does anybody here have any idea why the error pops up and how to fix it? Is it because "add_block" is applicable only to simulik, but not simscape? Or, do you have better idea to build physical model in command line?
Thank you.
Qi

回答 (1 件)

Steve Miller
Steve Miller 2023 年 4 月 22 日
You need to use this library path to refer to your block:
add_block('fl_lib/Thermal/Thermal Elements/Thermal Reference', 'ssc_dcmotor/Thermal Reference');
--Steve

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by