Count curves on Matlab plot with specific name
古いコメントを表示
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 件のコメント
Adam
2017 年 1 月 18 日
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
2017 年 1 月 18 日
Tyler Murray
2017 年 1 月 18 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!