How to make a particular folder open in matlab for saving images?

조회 수: 3 (최근 30일)
I am using regression learning for developing machine learning models. My intention is to save the figure (like residual plot) to a particular working folder. But whenever I click on "Export Plot to a Figure" option, a home directory opens. Then it takes well over 10 seconds for me to navigate to the folder in which I would require to save. This process needs to get repeated everytime, I am trying to save a figure. How to make a working folder open directly for saving?
  댓글 수: 3
Praveen Kumar M
Praveen Kumar M 2019년 6월 17일
Thank you for this advice. This would work when we are coding in commandline. Suppose i am using GUI interface for classification and regression learner app, in that case this would not be possible.
Stephen23
Stephen23 2019년 6월 17일
"This would work when we are coding in commandline."
And also when writing any code.
"Suppose i am using GUI interface for classification and regression learner app, in that case this would not be possible."
I don't see any reason why not, and you have not explained why you think there is some restriction on its usage (hint: there isn't).

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

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 6월 17일
In this case, to change directory with cd() command might be helpful to change the currrent directory to the directory where you wish to save the images.
  댓글 수: 2
Stephen23
Stephen23 2019년 6월 17일
Do NOT use cd for reading/writing data files.
Using cd to access data files is superfluous, slows down code, and makes debugging harder. The MATLAB path is intended for specifying the location of MATLAB code (functions, scripts, classes), and NOT for accessing data files.
The recommended method is to use relative/absolute filenames. All MATLAB functions that read/write data files accept relative/absolute filenames:

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

추가 답변 (0개)

카테고리

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