exportapp
Save figure including UI components as an image file.
📝Syntax
exportapp(fig, filename)
📥Input Arguments
Parameter Description
fig figure object: figure or UI figure to capture.
filename a character vector or string scalar: destination image file.
📤Output Arguments
Parameter Description
📄Description

exportapp(fig, filename) captures the figure fig, including all of its UI components, and writes it to the image file filename.

The output file format is determined by the extension of filename (for example .png, .jpg, or .tif).

Unlike saveas, exportapp is intended to export figures created with uifigure that contain UI components such as buttons, sliders, and tables.

💡Examples
f = uifigure('Position', [100 100 300 200]);
b = uibutton(f, 'Text', 'Export me');
exportapp(f, [tempdir(), 'exportapp_example.png']);
img = imread([tempdir(), 'exportapp_example.png']);
figure();
imshow(img)
🔗See Also
getframesaveasuifigure
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub