필터 지우기
필터 지우기

Need Help with "could not evaluate maskdisplay commands of block"

조회 수: 71 (최근 30일)
Ali Vali
Ali Vali 2022년 6월 10일
댓글: Vikram Kolupula 2023년 1월 14일
Hi everyone,
I am doing the selfpaced "Simulink Fundamentals". I am doing the "Masking Subsystems" and I am getting this error message "could not evaluate maskdisplay commands of block".
According to the instructions, I have to enter the following code in the "Code" tab:
% Initialization code section
function initialization()
str1 = "Kp = " + Kp;
str2 = "Ki = " + Ki;
label = [str1;str2];
end
% Parameter callback section
In the "Icon" tab, I have been instructed to add "disp(label);". When I submit the solution, I get the following error:
"Does the following block have the correct parameter settings?
Susystem:
MaskDisplay: disp(label)"
When I go back to the "code" tab, I have warning with the "label". The warning says that "the value assigned to variable 'label' might be unused". I am not sure what it means.
Would you please help me to resolve the issue?
Thanks,
Ali
  댓글 수: 3
Ali Vali
Ali Vali 2022년 6월 11일
Thank you walter. That line is not editable,
José Escobar Escobar
José Escobar Escobar 2022년 12월 27일
Hello Ali, I have the same problem, did you find a solution?

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

답변 (3개)

Prithvi Raj Pedapati
Prithvi Raj Pedapati 2022년 7월 18일
i too have the same issue in the beggining.... i figured out after several itrations. Try following this steps
  1. reset the assignement given
  2. the line of code is correctly given, try to use the same
str1="Kp=" +Kp;
str2="Ki=" +Ki;
label= [str1; str2];
3. In the display secction by default it shows
Disp ("gain")
remove "gain" and use the following code
Disp (lable) don't use " " as it is an array not a string.
This will work 100%, make sure no spell correction in the code and icon sections

Ramishetti sai sreeja
Ramishetti sai sreeja 2022년 6월 13일
Hi Ali Vali,
It is my understanding that, while completing self-paced "Simulink Fundamentals", you got an error while updating the initialisations of display block in mask editor.
These are lines of code as you mentioned,
str1="Kp=" +Kp;
str2="Ki=" +Ki;
label= [str1; str2];
I executed the above lines of code, and the error is not reproducible at my end.
I assume the error might be due to the end command at the end of the code which is to be removed.
If the error still persists, I recommend using the below lines of code:
str1=['Kp=' num2str(Kp)];
str2=['Ki=' num2str(Ki)];
label= char (str1, str2);
  댓글 수: 1
Ali Vali
Ali Vali 2022년 6월 13일
HI there,
Thank you for your suggestion. I can not delete 'end' because its grayed out. I also you used your code and I got the save error. The error says "The value assigned to variable 'label' might be unused" do you know what this means?
Please check the attached screenshot.
Thanks,
Ali

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


Ali Vali
Ali Vali 2022년 6월 15일
Hi everyone,
Could somebody help me with this problem? I would to continune on my course>
Thanks,
Ali

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by