Saving and attaching figure

1 visualización (últimos 30 días)
vani
vani el 2 de Nov. de 2022
Comentada: TARUN el 28 de Feb. de 2025
I saved my figure in the matlab server using 'saveas' option but I wanted to attach it to the email which I am not able to do it as it is saved inside the server and not in my desktop. How can I save the figure in my desktop and attach it to my email?

Respuestas (1)

TARUN
TARUN el 28 de Feb. de 2025
Hi @vani,
I understand that you are aiming to save a figure directly to your desktop from the MATLAB server.
To accomplish this, you need to specify a path that points to your local machine.
Below is an example of how you can achieve this:
fig = figure;
plot(1:10, rand(1,10)); % Example plot
% file path to your desktop
filePath = 'C:\Users\YourUsername\Desktop\myFigure.png'; % Add your file path here
saveas(fig, filePath);
Replace “YourUsername” with your actual username on the system.
Once you run this code, the figure will be saved on your desktop, and you can attach it to your email.
You can refer to the following MathWorks documentation for more information on saveas function: https://www.mathworks.com/help/releases/R2022a/matlab/ref/saveas.html?searchHighlight=saveas&searchResultIndex=1
  2 comentarios
DGM
DGM el 28 de Feb. de 2025
The question is asking how to save a file from MATLAB Online to local storage on their computer. Using saveas() doesn't work for that.
See also the thread linked in the answer.
TARUN
TARUN el 28 de Feb. de 2025

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by