Error using fileparts Too many output arguments. How do I solve it?
7 次查看(过去 30 天)
显示 更早的评论
Hello, I am running a script written for older version of MatLab in my 2011b version on a Windows PC. When I run it I get the message "Error using fileparts Too many output arguments." I've read this thread http://www.mathworks.com/matlabcentral/answers/101665 and also this one https://www.mathworks.co.uk/matlabcentral/answers/25236 but in my case I don't see the 4th argument anywhere or I don't know how to change it. Is there a file that I need to edit? If so, how do I know which one?
It's my first time using Matlab and my knowledge is reduced. Thank you in advance.
回答(2 个)
Vishal Rane
2014-1-10
Fileparts allows upto three output arguments. If the script is written for a older version of matlab, chances are the usage of fileparts is something like this:
[ path, name, ext, vers] = fileparts(tmp_fullfilename);
The fourth ouput argument is no longer supported (since R2010a I believe). If the usage of fileparts in your script is as above, correct it to something like this:
[ path, name, ext] = fileparts(tmp_fullfilename);
Also if that is indeed the case, ensure you take care of the 'vers' variable.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!