controlling manual switch through m-file

조회 수: 2 (최근 30일)
Krishnendu Mukherjee
Krishnendu Mukherjee 2012년 3월 13일
댓글: Jon 2020년 7월 28일
there in a manual switch,which can be altered during run time.now if i want to alter the switch through m-file command.what to do?
  댓글 수: 1
Krishnendu Mukherjee
Krishnendu Mukherjee 2012년 3월 13일
its to tel that the manual switch is in simulink.

댓글을 달려면 로그인하십시오.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 3월 13일
It looks like this should work
set_param('path/to/block', 'sw', '0')
set_param('path/to/block', 'sw', '1')
I found the names of the block parameters using this command, and just picked the one that seemed likely:
>> get_param(gcb, 'DialogParameters') % select the block first with the mouse
  댓글 수: 1
Jon
Jon 2020년 7월 28일
In version 2020A, for a manual switch (assuming it has just been selected)
get_param(gcb,'DialogParameters')
returns only the parameters varsize and SampleTime.
It seems that this 'sw' parameter does still give the switch postion, but where is this documented?
In particular is there a command similar to get_param(gcb,'DialogParameters') that would list this type of "hidden" parameter, or is there somewhere it would be listed in any of the documentation? I couldn't find it.
Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by