My Simulink model contains a mask with the following initialization code: plot test_var=1 When this code executes after changing a dialog parameter in the mask, the plot command should cause an error, however, no error message is displayed in the MATLAB command window. I tried using the following command to debug code execution: dbstop if error However, this did not work.
Prashant Kumar answered .
2025-11-20
try
plot
test_var=1
catch
disp('Failed mask initialization')
end
If you would like to debug the initialization code, you can place the mask initialization code in a MATLAB file function and debug the code from there.