Not able to extract data from fig file having subplots
이전 댓글 표시
There are 7 subplots in my fig file , am able to extract data from all but not able to extract data from 6 fig .
Could anyone tell me why the 6th subplot data am not able to extract am using this code.Once i execute the command
the data gets vanished from the figure file
clc
clear all
h=findobj(subplot(7,1,6),'Type','line');
x=get(h,'Xdata');
y=get(h,'Ydata');
for i =1:size(y)
z{i,1}=(y{i,1}');
end
댓글 수: 8
Ameer Hamza
2020년 10월 8일
Does axes 6 also contain a line object? Maybe it contains some other graphics object.
Sandeep Nair
2020년 10월 8일
Ameer Hamza
2020년 10월 8일
h = 0x0 means that it is not a line. Can you share your .fig file.
Sandeep Nair
2020년 10월 8일
Ameer Hamza
2020년 10월 8일
Check what type of graphic object is present. What is the output of these lines
ax = subplot(7,1,6);
ax.Children
Sandeep Nair
2020년 10월 8일
편집: Sandeep Nair
2020년 10월 8일
Ameer Hamza
2020년 10월 8일
Without knowing what is present in subplot 6, it is difficult to suggest a solution. The children property tells what type of object is children of that axes.
clc
clear all
ax = subplot(7,1,6)
h=findobj(ax,'Type','line');
x=get(h,'Xdata');
y=get(h,'Ydata');
for i =1:size(y)
z{i,1}=(y{i,1}');
end
use the property, value type arguments for findobj . pass the handle of subplot to findobj
답변 (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!