How can I save a UIaxes-figure in a Matlab-Web-App by button callback
6 views (last 30 days)
I would like to save a figure shown in a UIaxes of a deployed Matlab Web Aplication as png/jpeg-File in the ctfroot-directory.
example at button callback
The functionality of multiwindow to opy object to a new figure is not supported and i don't know how to access the figure in UIaxes.
Any help is appreciated
Benjamin Großmann on 11 Nov 2021
Edited: Benjamin Großmann on 11 Nov 2021
You can use exportgraphics(obj,filename) to write a graphics object obj to filename on the web app server temporarily. Afterwards call web(fileName) to display and/or download the file in the browser.
function PrintButtonPushed(app, event)
fileName = 'graphic.pdf';
% or query for filename:
% [fileName, ~] = uiputfile('*.pdf');