how to Call back API calls the value of Constant Block 如何使用Call back API 调用Constant Block的值

I have set a variable in the Constant block and want to view its definition through the call back method
在Constant block中设置了变量, 想通过call back的方式查看该变量的定义

 채택된 답변

Xiaoning.Wang
Xiaoning.Wang 2023년 11월 19일

댓글 수: 2

set_param(gcbh,'AttributesFormatString',[val,char(13,10)',valstr]); 表示换行
运行结果如下:
>> [val,char(13,10)',valstr]
ans =
cVcScFeh_B_DCDCUnavailTest
0
注意:char(13,10)',
如果Constant 不是单单的一个值,而是其他公司定义的标定量,则
val=get_param(gcbh,'Value');
%valstr=num2str(evalin('base',val));
valstr=num2str(eval([val,'.Value'])); %标定量的Value
%set_param(gcbh,'AttributesFormatString',[val,'=',valstr]);
set_param(gcbh,'AttributesFormatString',[val,char(13,10)',valstr]);

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 创建 System object에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2023년 11월 19일

댓글:

2024년 10월 25일

Community Treasure Hunt

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

Start Hunting!