Filter löschen
Filter löschen

add path in matlab folder

1 Ansicht (letzte 30 Tage)
Lavanya M
Lavanya M am 21 Apr. 2016
Beantwortet: Guillaume am 21 Apr. 2016
How to add(save as) path in matlab folder after writing program.The path is getting saved as user path.what do I do..??

Antworten (2)

Brattv
Brattv am 21 Apr. 2016
Bearbeitet: Brattv am 21 Apr. 2016
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 Kommentar
Guillaume
Guillaume am 21 Apr. 2016
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.

Melden Sie sich an, um zu kommentieren.


Guillaume
Guillaume am 21 Apr. 2016
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');

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by