I'm working on a Simulink model that updates a plot every time step of the model. The plotting is done within an embedded Matlab function. I can make this work for a generic figure that I call in the basic 'figure(1); plot(x, y)' sense, but ideally I'd like to be able to pass a figure handle to the embedded Matlab function, so that I can create the figure with specific properties when I initialise the model, then plot it to directly, but I get errors whenever I try. Are figure handles just completely unsupported by embedded Matlab functions or is there a way to do this? I'm sure this used to work back when figure handles were just doubles, but now they are objects Simulink doesn't seem able to do this anymore.
Further to this, I would then like to capture this plotted image as an image matrix for further processing. Usually I would do this with the 'getframe' function, but I get an error that says the function is unsupported for code generation. Does anyone have a workaround? Any help would be greatly appreciated.
Many thanks, Chris