How to open a saved figure?
Afficher commentaires plus anciens
I save figures to a MasterStruct for later access to store data, i am trying to open the figures using two different methods:
1.
figure(MasterStruct(k).fighandle)
Error using figure
Argument must be a Figure object or a positive integer.
class(MasterStruct(k).fighandle)='matlab.ui.Figure'
2.
openfig("file/subfolder/fighandle.fig")
figure(fighandle)
Error using figure
Argument must be a Figure object or a positive integer.
How can i open these previously made figures? the workspace identifies fighandle as a 1x1 figure
Réponses (1)
Fangjun Jiang
le 30 Jan 2023
0 votes
If you have the figure saved in a .fig file, I think it should be
open('file/subfolder/fighandle.fig')
4 commentaires
Nicholas Kavouris
le 30 Jan 2023
Fangjun Jiang
le 30 Jan 2023
Modifié(e) : Fangjun Jiang
le 30 Jan 2023
figure handle is dynamically assigned. Run below to get an idea
clear all;close all;
plot(rand(3));
savefig;close all;
a=openfig('Untitled.fig')
b=findobj('type','Figure')
class(a)
class(b)
isequal(a,b)
Nicholas Kavouris
le 30 Jan 2023
Fangjun Jiang
le 30 Jan 2023
Use variable "a" and "b" above, "a" is a figure handle. It contains meta data of the figure. You could do
open a, it opens the figure property editor
but openfig(a) errors because openfig() expects a .fig file name.
Catégories
En savoir plus sur Printing and Saving dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
