フィルターのクリア

Changing the size and position of the simulink block

224 ビュー (過去 30 日間)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2015 年 5 月 22 日
コメント済み: Manuel K 2022 年 11 月 8 日
How can I change the position and size of the simulink block from the matlab command window?
sys = 'testmodel';
new_system(sys);
load_system(sys);
add_block('Simulink/Commonly Used Blocks/Subsystem',[sys '/subsystem])
add_block('builtin/Outport','testmodel/ouput1','MakeNameUnique','on')
now i have created one subsystem and one outport.
what are the commands i need to use for changing the model size and position of the block?
Thanks a lot

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 5 月 22 日
set_param('Model_Name/Block_Name','Position',[50 50 200 100])
  5 件のコメント
Nabil akroud | نبيــل عكرود
編集済み: Nabil akroud | نبيــل عكرود 2021 年 11 月 18 日
by using get_param
  • get_param(Object,Parameter)
for example, the following code will open the vdp example and will give you the position of the gain block (Mu) inside it:
open_system('vdp')
get_param('vdp/Mu','position')
Abdelghafar Elkhaoui
Abdelghafar Elkhaoui 2022 年 3 月 27 日
@Slimeni Omar to get the position of any block in simulink model :
get_param('Model_Name/Block_Name','Position')

サインインしてコメントする。

その他の回答 (1 件)

Prerana Ozarkar
Prerana Ozarkar 2019 年 3 月 5 日
編集済み: Prerana Ozarkar 2019 年 3 月 5 日
You need to use following command:
get_param(pathOfsystem, 'Position')
this will retuen you a 1X4 matrix in which positions will be stored in a manner [X Y Width Height]
  1 件のコメント
Manuel K
Manuel K 2022 年 11 月 8 日
It's actually a: vector of coordinates, in pixels: [left top right bottom]

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by