How to solve the error Not enough input arguments?

2 ビュー (過去 30 日間)
india king
india king 2016 年 3 月 12 日
回答済み: Walter Roberson 2016 年 3 月 12 日
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 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by