extract points from line plot
조회 수: 6 (최근 30일)
이전 댓글 표시
I have a line plot and I tried to extract points from the line using YData=get(get(gca,'children'),'YData');, how do I set the number of points that I extracted?
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 8월 27일
You cannot set the number of points. You will extract all of them using that code. After you have extracted them all, you can throw some of them away.
If you wanted to restrict the number of objects (e.g., lineseries objects) that you extracted data from, then you could use
MaxObj = 17; %for example
ch = get(gca, 'Children');
if length(ch) > MaxObj; ch(MaxObj+1:end) = []; end
YData = get(ch, 'YData');
This would not be the same as limiting the number of points, because each line or lineseries object might have a different number of points.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!