MATLAB Answers

How to solve eigs/checkInputs issue in EOF analysis?

9 views (last 30 days)
Subhodh Sharma
Subhodh Sharma on 21 Aug 2021
Answered: Christine Tobler on 23 Aug 2021
I am trying to do the EOF analysis using the the function of climate data toolbox. My data has the same form as the provided "sst example". However, I can't seem to solve it. My data has dimensions (20 * 20 * 60). First, two is spatial info and the last one is time. I am trying to find the EOF first mode using this command "output=eof(data,1)".
In the website they same way calcualte the first mode as follows ":output=eof(sst,1)", where sst has dimension (60*50*802).
Error using eigs/checkInputs (line 541)A number of eigenvalues requested, k, must be a positive integer not greater than n = 0. Instead, it was 1.
Error in eigs (line 97)
Error in eof>mycaleof (line 145)
[V,D] = eigs(R,N_eofs); % matrix of eigenvectors V and diagonal matrix of eigenvalues D
Error in eof (line 85)
[E,pc,expvar] = mycaleof(A,n); % An edited version of Guillame MAZE's caleof function, which appears as a subfunction
The above error is coming. I am stuck on this issue, I would really appreciate your help.
  1 Comment
Steven Lord
Steven Lord on 21 Aug 2021
What are the sizes of R and N_eofs on that line?
If N_eofs is a scalar (1-by-1) what is its value?
Are you trying to solve the generalized eigenvalue problem (find V and D such that R*V equals N_eofs*V*D) or the regular eigenvalue problem finding only a limited number of eigenvalues (find the N_eofs largest magnitude eigenvalues such that R*V equals V*D)?

Sign in to comment.

Answers (1)

Christine Tobler
Christine Tobler on 23 Aug 2021
The error here is happening because R eof>mycaleof is an empty matrix, and eof is trying to compute an eigenvalue of it. Looking at the eof file exchange package, it seems that this would happen either if input A is empty, or if A contains too many NaN values.

Community Treasure Hunt

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

Start Hunting!

Translated by