How to solve the error Not enough input arguments?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!