Error using fileparts Too many output arguments. How do I solve it?

16 ビュー (過去 30 日間)
Elena
Elena 2014 年 1 月 10 日
コメント済み: Elena 2014 年 1 月 10 日
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.
  1 件のコメント
Friedrich
Friedrich 2014 年 1 月 10 日
Can you post the line which raises the error?

サインインしてコメントする。

回答 (2 件)

Elena
Elena 2014 年 1 月 10 日
Thank you for your answer! What do you mean? The script has a panel and I am working from the panel so I am not writing anything on the terminal so I don't know.. In the terminal there's nothing but the error. Error using fileparts Too many output arguments.
  2 件のコメント
Friedrich
Friedrich 2014 年 1 月 10 日
click on the error and you should get to the source code/the line which raises the error. How does that line look?
Elena
Elena 2014 年 1 月 10 日
Hey. I can't click the error.. I mean, if I click nothing happens.

サインインしてコメントする。


Vishal Rane
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.
  1 件のコメント
Elena
Elena 2014 年 1 月 10 日
Sorry I don't understand your answer. Where do I find this fileparts? What you mention is it a line in some part of the script and I just have to replace the: [ path, name, ext, vers] = fileparts(tmp_fullfilename); for the: [ path, name, ext] = fileparts(tmp_fullfilename);
?
Thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by