Error in using eigs: Error using arpackc, Expect 2 output arguments
3 views (last 30 days)
Show older comments
Fuwei Yang
on 17 Jan 2017
Commented: Walter Roberson
on 8 Apr 2018
I was using function eigs but I met a problem:
[D,V]=eigs(F,E)
Error using arpackc
Expect 2 output arguments
Error in eigs (line 240)
arpackc( aupdfun, ido, ...
If I use eig instead of eigs, it will work correctly. My matlab virson is R2015b. What can I do to solve this? thank you very much!
2 Comments
Walter Roberson
on 8 Apr 2018
See my explanation below. This is not a Mathworks error, it is due to old code being in your path. Look for eigs and eigs_new
Accepted Answer
Walter Roberson
on 28 Jun 2017
I just got hit with this in a third-party package. Someone had taken a 2008 copy of MATLAB's eigs and copied it, perhaps with some modifications, and named the file eigs_new.m but did not even bother to rename the function inside the file. The calls in the code to arpackc were not written with any output arguments. It appears that at some point between 2008b and 2013a, the internal undocumented arpackc was modified to expect two outputs from the function call.
In other words, the cause of this problem is that you (somehow) are using an eigs source code that was written for an older version of MATLAB than you are using. Use
which -all eigs
to figure out which eigs.m you are picking up. What you should be picking up is in the MATLAB installation directory for your version in toolbox/matlab/sparfun/eigs.m . Find the file you are getting instead and move it out of the way or adjust your MATLAB path with pathtool so that you get version appropriate for your release instead.
2 Comments
Chi-Hao Wu
on 5 Aug 2017
What a coincidence! The same error I got was also in a file named "eigs_new.m" whose function name inside was "eigs".
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!