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?

1 Ansicht (letzte 30 Tage)
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!

Akzeptierte Antwort

Mahfoud Alibrahim
Mahfoud Alibrahim am 11 Mai 2017
Bearbeitet: Mahfoud Alibrahim am 11 Mai 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

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by