How can I send a value from GUI to constant block in Simulink Model?

조회 수: 1 (최근 30일)
bayram özmen
bayram özmen 2017년 12월 12일
댓글: KL 2017년 12월 12일
I have threee constant block. And I want to value to those from GUI when ı pushed the button after ı take value from edit text blocks.

채택된 답변

Birdman
Birdman 2017년 12월 12일
As far as I know, edit text blocks takes input arguments as string. What you need to do is to use set_param command and convert the variables to double by using str2double command.
We have had a previous discussion about it, so please refer to that discussion. Here is an example:
set_param('gui/Constant','Value','i')
set_param('gui/Constant1','Value','j')
Do not forget to convert these values to double.
  댓글 수: 12
KL
KL 2017년 12월 12일
this is not recommended...
@Birdman: yet you recommend it.
@bayram özmen: Please be warned about the risks associated with using assignin.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by