make a new folder with specifued name and then put 2 matrix(.xls file) inside the folder

does anyone know how can i make new folder with MATLAB while:
a=[]; %(a=xlsread('refrence1.xls'))
b=[]; %(b=xlsread('input1.xls'))
if a=b
make new folder in 'refrence1' name and put 'refrence1.xls' and 'input1.xls' inside this folder
and if folder in name of 'refrence1' there is then only put 'refrence1.xls' and 'input1.xls' inside this folder without making other folder.
end

 채택된 답변

and
EIDT
directory = 'C:\pathWithExcelFiles\reference1';
if exist(directory,'dir') ~= 7
mkdir(directory)
movefile('C:\pathWithExcelFiles\reference1.xls',directory)
movefile('C:\pathWithExcelFiles\otherfile.xls',directory)
end

댓글 수: 8

See also exist() with the 'dir' option.
nice, now how can put 2 .xls files inside this folder
thanks Walter
could you explain more for example:
foldername is 'refrence1' and if doesn't exist make a folder with this name
dear Oleg movefile not makes copy nad paste but i need copy and paste. is there this command in MATLAB?
copyfile() instead of movefile() then.
perfect, thanks a lot
my last question:
how can know the folder is existing or not?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by