How to solve the error Not enough input arguments?

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.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 12일
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개)

카테고리

도움말 센터File Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

질문:

2016년 3월 12일

답변:

2016년 3월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by