MATLAB: How to access the title of a matlab fig file MATLAB 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 Best Answer plot(1:10);title('abc');h1=get(gca,'title');titre=get(h1,'string')With newest version of Matlabplot(1:10);title('abc');h1=gca, titre=h1.Title.String Related SolutionsMATLAB: One common Y-axis label for two or more plots I would propose you to get the Handle of the subplots and then work with that.Sample codeFigH = figure;SP1H = subplot(2,1,1);SP2H = subplot(2,1,2);YLabel1H = get(SP1H,'YLabel');set(YLabel1H,'String','YLabelThatIWant');set(YLabel1H,'Position',[-0.0542 0 0]);Title1H = get(SP1H,'Title');set(Title1H,'String','TheTitleThatIWant');HTH MATLAB: Matlab 2014b: Copying just the legend from existing figure into subplot One way is to save and reuse just the legend object itself, e.g., plot(1:5,2:6,1:5,0:4); hleg=legend('First Line', 'Second Line'); save tst hleg clear hleg load tst hleg figure; s6 = subplot(2,3,3); plot(10:10:50,(2:6).^2,10:10:50,(0:4).^2); legend(hleg.String{:}) Related QuestionLegend error. What did I do wrong hereTitle causes error when trying to plot graphHow to show legend as subfigureUnknown axes in GUI
Best Answer