How to call a saved fig file
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to output multiple saved fig files to one figure. I would appreciate it if you could tell me how.
0 comentarios
Respuestas (1)
Jai Khurana
el 15 de Feb. de 2023
Hi,
To output multiple saved fig files to one figure, you can use the "openfig" function to open each saved fig file as a separate figure, and then copy the contents of each figure to a single figure using the "copyobj" function. Here's an example code snippet that demonstrates this:
% Specify the file names of the saved fig files
fileNames = {'figure1.fig', 'figure2.fig', 'figure3.fig'};
% Create a new figure to combine the saved fig files
combinedFig = figure();
% Loop through each saved fig file
for i = 1:length(fileNames)
% Open the saved fig file as a separate figure
figHandle = openfig(fileNames{i});
% Get the handle to the axes object in the separate figure
axesHandle = gca(figHandle);
% Copy the axes object from the separate figure to the combined figure
copyobj(axesHandle, combinedFig);
% Close the separate figure
close(figHandle);
end
0 comentarios
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!