Is there a saveas function for axes/graphs in App Designer?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
We are trying to save a graph as jpg in App Designer, is there a function that is able to do this?
0 Kommentare
Antworten (1)
prabhat kumar sharma
am 2 Apr. 2024
Hi Laura,
I understand you want to save your graph as a jpg image. I belive saveas function is not supported with figures created using uifigure, which is the type of figure used in MATLAB App Designer.
However, exportgraphics is designed to work with uifigure-based figures, making it the recommended approach for saving graphics from App Designer apps.
Please find the below code for refrence:
% Create some data and plot it
x = linspace(0, 2*pi, 100);
y = sin(x);
fig = figure;
plot(x, y);
% Save the figure to a JPG file using exportgraphics()
filename = 'plot_exportgraphics.jpg';
exportgraphics(gca, filename);
I hope it helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!