How can I modify the s-function for the XY-Graph in Matlab-Simulink so that it clear the graph periodically or provide a marker for the head of the graph?

7 views (last 30 days)
I know that I can edit the s-Funktion for the XY-Graph in Matlab-Simulink and change it according to my needs, but I'm not much familiar with the programming of s-function, so does anyone know, how could I change the sfunxy.m to clear the graph periodically or provide a marker for the head of the graph? Thank you!

Accepted Answer

Mahfoud Alibrahim
Mahfoud Alibrahim on 11 May 2017
Edited: Mahfoud Alibrahim on 11 May 2017
Hello, I found the following method, which could help:
you can edit the s-function for the XY-Graph in that you type the following instruction On MATLAB Command Window:
edit sfunxy.m
To provide the data-points with a marker you can do the following:
Go to the line(number about 239):
set(ud.XYLine, 'LineStyle','-');
and replace it with:
set(ud.XYLine, 'LineStyle','-', 'Marker','*');
To clear a part of the plot, go to the line (number about 396 in matlab 2015):
new_line = feval(@()hg2sample.ScopeLineAnimator('maxNumVertices',50000));
Here you can change the numbers of the 'maxNumVertices' to got the desired Display on the XY-Graph. For Exempel you can type 10 instead of 50000 to display just the last ten data-points in the XY-Graph.
Regards
Mahfoud

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!