필터 지우기
필터 지우기

How to save matlab plot automatically into a folder as a JPG

조회 수: 142 (최근 30일)
Onur Hakverdi
Onur Hakverdi 2021년 4월 17일
댓글: Onur Hakverdi 2021년 6월 15일
Hello I have csv data file and I am plotting it but I need to save this plot as JPG into a folder automatically, how can I do that ?
  댓글 수: 13
Onur Hakverdi
Onur Hakverdi 2021년 4월 17일
also I tried to specific folder Error using saveas (line 138)
Invalid or missing path: C:\Kullanıcılar\yeni\plot.jpg
Error in csvdeneme (line 10)
saveas(gcf, 'C:\Kullanıcılar\yeni\plot.jpg');
than I got this error.
Onur Hakverdi
Onur Hakverdi 2021년 6월 15일
cd C:\Users\Dowloand\
saveas(gcf,'plot.jpg'); this code solved my problem

댓글을 달려면 로그인하십시오.

답변 (1개)

Shivang Srivastava
Shivang Srivastava 2021년 4월 21일
As per my understanding you wanted to save a plot as a jpg file into a folder. I tried to reproduce the error you are facing but the error was not reproducible at my end.
data = csvread('test.csv');
wavelength = data(:,1);
intensity = data(:,2);
plot(wavelength, intensity);
ylabel('wavelength');
xlabel('intensity');
title('wavelength-intensity');
saveas(gcf,'C:\test.jpg','jpg')
You can go through the following documentation for more information on saveas function.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by