Why do I get a mask display of "???" when I set the Icon & Ports Dialog field with a script that uses &1, &2, &3 notation that is called from the Mask Initialization Tab in Simulink 7.3 (R2009a)?

조회 수: 4 (최근 30일)
I have a masked subsystem. I wish to update the mask display by calling a script from the Initialization tab. This initialization tab sets the Icon & Ports field with the SET_PARAM command and uses &1, &2 notation to access the dialog parameter fields:
lineInfo = ['fprintf(''%s Seg, Type %s\n%s\n%s\n\n\n'', &2, &1, &4, &3 );' char(10) ];
set_param( theBlk, 'MaskDisplay', lineInfo );
However, when I click Apply, I recieve "???" on the mask. If I click Okay or Update Diagram, the mask resolves correctly and the ??? goes away. Why is this?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
The use of &1 and &2 notation to access dialog parameters is not recommended. Instead, use GET_PARAM to access these fields.
lineInfo = ['fprintf(''%s Seg, Type %s\n%s\n%s\n\n\n'', get_param(gcb, "dialogparameter1"),' ...
'get_param(gcb, ''dialogparameter2''), get_param(gcb, ''dialogparameter3''), get_param(gcb, ''dialogparameter4'') );' char(10) ];

추가 답변 (0개)

카테고리

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

제품


릴리스

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by