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

15 views (last 30 days)
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

Accepted Answer

Oleg Komarov
Oleg Komarov on 3 Sep 2011
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 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!