How to open VR Sink simulation,with a button in app designer ?

2 ビュー (過去 30 日間)
Kadir Çolak
Kadir Çolak 2024 年 5 月 13 日
コメント済み: Ayush Singh 2024 年 5 月 21 日
Hello everyone , İ have a question
when i click on the vr sink model ,i can see block parameter properties.
i need to do, open VRSink file simulation in app designer .How can i do it ?
and Can i change ;"open wiever automatically" output from app designer with code ?

回答 (1 件)

Ayush Singh
Ayush Singh 2024 年 5 月 15 日
編集済み: Ayush Singh 2024 年 5 月 15 日
Hey Kadir
To open the VR Sink Model in app designer code you can use the 'load_system' to load the model and 'sim' command to simulate the model.
h = load_system('myModel')
Where 'myModel' is the name of the Simulink model file you want to load. This name can include a full path if the model is not in the current working directory or on the MATLAB path.
Once the model is loaded, now you can use 'set_param' to change the 'open viewer automatically' from code:
set_param(h,'AutoView','off')
if you want to put it to 'off' or:
set_param(h,'AutoView','on')
For more information on above functions, you can refer to following links:
Hope it helps you!
  3 件のコメント
Ayush Singh
Ayush Singh 2024 年 5 月 20 日
If it is possible can you plese attach the model itself so that I can try to understand why the error is occuring?
Ayush Singh
Ayush Singh 2024 年 5 月 21 日
If its not possible for you to share the model, you can view the Dialog Parameters of the model using below command and share the output here:
path = 'path to your model';
h = getSimulinkBlockHandle(path,true);
a=get_param(h,'DialogParameters');
This will list down all the Dialog Parameters one of which will control the 'open viewer automatically' property.

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

カテゴリ

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

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by