Pleas how can i creat a variable in mask that can be calculated from other two variables from the same mask like x=a+b, i tried to use the instruction ' * set_param('model/block','variable','a+b');*' in the Initialization, but no result appear in the mask, pleas how can i make this variable automaticly updated working?

댓글 수: 2

TAB
TAB 2018년 6월 4일
Do you want to create a temporary variable ? Or a mask parameters ?
Badr Taleb
Badr Taleb 2018년 6월 4일
no i'm trying to creat a mask parameter.

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

 채택된 답변

TAB
TAB 2018년 6월 4일

1 개 추천

In Mask Initialization function
aVal = str2double(get_param(gcbh, 'a')); % a is existing mask parameter
bVal = str2double(get_param(gcbh, 'b')); % b is existing mask parameter
set_param(gcbh, 'c', num2str(aVal+bVal)); %c is existing mask parameter

댓글 수: 1

Badr Taleb
Badr Taleb 2018년 6월 4일
thank you for your help. it's working

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Author Block Masks에 대해 자세히 알아보기

제품

릴리스

R2016b

태그

질문:

2018년 6월 3일

댓글:

2018년 6월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by