add path in matlab folder

조회 수: 2 (최근 30일)
Lavanya M
Lavanya M 2016년 4월 21일
답변: Guillaume 2016년 4월 21일
How to add(save as) path in matlab folder after writing program.The path is getting saved as user path.what do I do..??

답변 (2개)

Brattv
Brattv 2016년 4월 21일
편집: Brattv 2016년 4월 21일
Hi, Try using the "cd" function to change the current folder
if true
% Changing folder to desktop before saving figure(1)
cd('C:\Users\....\Desktop')
saveas(figure(1),'png')
end
  댓글 수: 1
Guillaume
Guillaume 2016년 4월 21일
No! Avoid using cd at all cost. Much better to specify the full path of the file to save.
If you cd functions that were previously visible to matlab may not be accessible anymore and new ones may be visible.

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


Guillaume
Guillaume 2016년 4월 21일
Just specify the path with the filename. You can use fullfile to build the full name:
saveas(hfig, fullfile('C:\folder\where you want\to save', 'somename.png');

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by