Loading a fig file without opening

조회 수: 39(최근 30일)
JPS
JPS 2021년 2월 8일
댓글: JPS 2021년 2월 11일
Hi,
I have .fig in the current directory and wish to extract data from it. I used the following code for this purpose,
open('power.fig');
a = get(gca,'Children');
xdata = get(a, 'XData');
ydata = get(a, 'YData');
The code works. My problem is it also opens the fig file in a separate figure window. I don't want that to happen. I just want to extract the data.
Ofcourse I could use,
close figure
But it just takes out the graph and shows an empty figure window.
I would be very much grateful if somebody could help me in this.
Thanks in advance!

채택된 답변

Fangjun Jiang
Fangjun Jiang 2021년 2월 8일
편집: Fangjun Jiang 2021년 2월 8일
f=openfig('power.fig','invisible')
a=get(f,'Children')
...
close(f)
clear f
  댓글 수: 1
JPS
JPS 2021년 2월 11일
Thank You Mr. Fangjun Jiang !

댓글을 달려면 로그인하십시오.

추가 답변(0개)

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by