setting simulink block values from command line

조회 수: 1 (최근 30일)
Thijs
Thijs 2011년 2월 23일
댓글: Anmol Kodgire 2018년 9월 20일
Hi,
Does anyone know whether it is possible to pass a variable name to a simulink block when defining it from the command line? So in the following code:
src='built-in/Constant'; dest=strcat(systemname,'/','example'); add_block(src, dest, 'Value', '5', 'position',position)
instead of '5', i would like to pass a variable name e.g. 'a' which can later be defined in an m-script.
regards, Thijs

채택된 답변

Paulo Silva
Paulo Silva 2011년 2월 23일
set_param('systemname/blockname','Value','a')
  댓글 수: 1
Anmol Kodgire
Anmol Kodgire 2018년 9월 20일
i have value stored in a variable.(e,g a=5) how can i get the value stored in variable (i.e 5). if i use your logic, the block will have value 'a'

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by