필터 지우기
필터 지우기

Save files using MATLAB

조회 수: 1 (최근 30일)
Siam
Siam 2014년 9월 4일
댓글: Geoff Hayes 2014년 10월 14일
Hi,
I have used a function like below.
function rough1(src,des)
p = dir(fullfile(src,'*.tif'));
mkdir(des);
....
...
...
end
and in the command window i was calling this
  • src= [uigetdir('')];
  • des = uiputfile;
  • rough1(src,des)I can select any folder for processing. I can select any directory for save and can give a folder name. However; it by default saves in MATLAB. As for example if I want to save this to desktop and select it, it still saves in MATLAB.

채택된 답변

Geoff Hayes
Geoff Hayes 2014년 9월 4일
Siam - uiputfile is used for choosing the filename and directory where you want to save the new file. If you want the path (as well as the file name) you would have to do something like
[filename,pathname] = uiputfile;
But since your are moving/copying multiple files, you don't need to choose a file name. So I think that you want to re-use the call to uigetdir to set the destination folder. Try the following
srcPath = uigetdir('');
destPath = uigetdir('');
rough1(srcPath, destPath)
I tried this, and was able to save all tifs from one directory to a folder on my desktop.
  댓글 수: 10
Siam
Siam 2014년 10월 14일
As for example if my input image is (lets say : image-10-00, image-10-01, image_10_02 >>> now I can save them as process_1, process_2,process_3 serially but not exactly as the same input image title).
Any advice will be appreciated.
Geoff Hayes
Geoff Hayes 2014년 10월 14일
Siam - I'm not really sure what you are asking. As this doesn't really correspond to the original question, you should post a new one. Please make it absolutely clear what you are looking for.

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

추가 답변 (0개)

카테고리

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