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

 Réponse acceptée

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 commentaires

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?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by