How to access the title of a matlab fig file
조회 수: 154 (최근 30일)
이전 댓글 표시
I've opened a fig file. Let's call it
fig_1=openfig('sample.fig')
Now fig_1 is a figure object.
Where the title string of the relative plot is stored and how to get it? Thanks
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2015년 6월 24일
편집: Azzi Abdelmalek
2015년 6월 24일
plot(1:10);
title('abc');
h1=get(gca,'title');
titre=get(h1,'string')
With newest version of Matlab
plot(1:10);title('abc');
h1=gca,
titre=h1.Title.String
추가 답변 (1개)
Adam
2015년 6월 24일
If you mean the figure title as you say then:
fig_1.Name
post R2014b or
get( fig_1, 'Name' )
before R2014b
gives you what is shown in the figure's title bar. If you really mean a plot title then refer to Azzi Abdelmalek's answer, but you should be careful to be more specific in your question if that is the case.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!