Count curves on Matlab plot with specific name
Ältere Kommentare anzeigen
Is there a way to count how many curves are on a specific Matlab Figure? I define the name of plot as
figure('Name','Simulation', 'NumberTitle', 'Off')
Since I have multiple plots generated at various times I am unable to use gcf. What I would like to do is something like
length(findall('type','line','Name','Simulation')
to find all curves associated with the plot (or plots) named Simulation.
3 Kommentare
Adam
am 18 Jan. 2017
I'm not sure I understand what you mean. You say a 'specific Matlab Figure' which implies you already know your figure, yet it is the figure you are naming. Line objects do not have a 'Name', only a 'DisplayName' and this would generally be different for multiple lines on the same axes as it appears on the legend, though I guess it can be the same for multiple lines.
So what exactly are the criteria you are trying to search for?
Obviously, as with almost anything of this nature, it is usually far easier to keep track of these things on the raw data before/when you do the plotting rather than a post-plotting slow search of graphics objects.
Tyler Murray
am 18 Jan. 2017
Tyler Murray
am 18 Jan. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!