How to solve the error Not enough input arguments?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
india king
am 12 Mär. 2016
Beantwortet: Walter Roberson
am 12 Mär. 2016
i am trying to create and enter the current folder using this code:
mkdir(strcat('s',num2str(n)));
cd(strcat('s',num2str(n)));
matlab is giving error not enough inpur arguments. Please help me solve this issue.
whats wrong in the code. Please provide the correct code as i need it uregently for my project.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 12 Mär. 2016
if ~exist('n', 'var')
error('You need to define n to use this code');
end
foldername = sprintf('s%d', n);
if ~exist(foldername, 'dir')
mkdir(foldername);
end
cd(foldername);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations 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!