Does someone know a way how to update/draw subsystem's input or output results in runtime? In this sense, one could do a Scope block, which updates itself during the simulation, so one could see the results already by looking at the block.
Of course, my intention is not making a scope block but make some custom drawings based on results inside the subsystem in runtime.
This would mean either to:
- be able to access a variable with results in
plot
command of masked subsystem and making sure that Simulink calls refresh everytime the variable changes - change
MaskDisplay
from outside, for example by inputting absolute values inplot
command and signaling to Simulink that it needs to refresh that Subsystem's drawin开发者_开发技巧g
One way of to use a MATLAB Function block and declare plot, for example, as an extrinsic:
coder.extrinsic('plot');
You can then use plot in the MATLAB Function. You can also do this for a custom MATLAB file:
coder.extrinsic('my_custom_draw_function');
Somewhat more complicated can be to use m-file s-function.
精彩评论