Changing the units inside a PS-Simulink Converter block programmatically

14 ビュー (過去 30 日間)
Vincent Finello
Vincent Finello 2023 年 12 月 7 日
編集済み: Angelo Yeo 2023 年 12 月 8 日
Hello,
I have a very large simscape model with several custom blocks for pressure and temperature sensors. Within these custom blocks there's a PS-Simulink Converter block. I'm trying to change the Output signal unit from Pa to psi via a program so that I can change units in one line of code rather than having to switch each block in my model manually. I've tried get_param but it doesn't seem to be working.
Best,
VF

回答 (1 件)

Angelo Yeo
Angelo Yeo 2023 年 12 月 8 日
編集済み: Angelo Yeo 2023 年 12 月 8 日
You can click one block and run get(gcbh). The result tells you detailed properties of the block. From this you can learn that the "MaskType" of Simulink-PS Converter block is called "Simulink-PS Converter".
Below is one for Simulink-PS Converter using a shipped example.
openExample('simscape/MassSpringDamperWithControllerExample');
blks = find_system(bdroot,'FindAll','On','MaskType', 'Simulink-PS Converter');
set(blks, 'Unit', 'rad/s')

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by