MATLAB Answers


Is it possible for the XY Graph block in Simulink 7.5 (R2010a) to have the capability to draw until a particular time, clear the figure, and start redrawing again?

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.




1 Answer

Answer by MathWorks Support Team on 28 Jul 2010
 Accepted Answer

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:
>> matlabroot
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.


Sign in to comment.