フィルターのクリア

Is it possible to toggle a manual switch via pressing a keyboard button in a running Simulink environment?

3 ビュー (過去 30 日間)

採用された回答

Abhishek GS
Abhishek GS 2015 年 4 月 6 日
Hi TZEEEE,
If you are looking to control the 'Manual Switch' via keyboard, I am afraid it is not possible by pressing a simple keyboard button. The closest you get could get to it is by using a 'Switch' block like below.
Now, while this model is running (Lets say Stop Time = inf), on the command line you will have to enter the following commands:
ctrl = 1 % or ctrl = 0
set_param(gcs,'SimulationCommand','Update')
Once, the Simulink Model is updated the new value for the variable 'ctrl' used in the ControlValue constant block takes its effect.
Note that you could also update the model using keyboard shortcut "Ctrl+D".
Thanks, Abhishek

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by