Every time I complete plotting in a particular range, I should be able to clear the figure and start re-plotting. I need to be able to conditionally refresh the XY Graph block in Simulink.
This ability to conditionally refresh the display of the XY Graph block is not available in Simulink 7.5 (R2010a).
As a workaround, you can write an S-function that achieves this functionality. The S-function for the existing XY Graph block is available for editing at the following location:
where $MATLABROOT is the value returned by executing the following command at the MATLAB command prompt:
As an example, see the attached files. This S-function clears the XY Graph data whenever there is a rising edge at the third input port to this block. The period of the pulse generator is set such that the graph will be cleared after each half-circle is drawn.