Error message when trying to compute EOF with covariance matrix.
Show older comments
I am trying to compute EOFs from a code I used before, but it does not seem to work here since my dataset has a too good spatial resolution (1/4 degree).
I want to compute the firsts 2 EOFs of mean June SLP northward of 70N for 43 years.
latitude has size 81 (4x20 = 80)
longitude has size 1440 (4x360 = 1440)
The data I want to compute the EOFs from has size 1440x81x43 (latitude x longitude x time)
When I want to compute the covariance matrix, I can't. I get the following error message:
Error using *
Requested 116640x116640 (101.4GB) array exceeds maximum array size preference (62.6GB). This might cause
MATLAB to become unresponsive.
Error in cov (line 155)
c = (xc' * xc) ./ denom;
Related documentation
%% Compute EOFs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%I CAN'T ATTACH MY DATA SINCE IT IS 31.1mb AND THE LIMIT IS 5 MB
load('mslpJune_dt.mat'); %load detrended data
mslpJune_dt_reshaped = reshape(mslpJune_dt,[1440*81 43]);
mslpJune_dt_reshaped_trans = transpose(mslpJune_dt_reshaped);
%I CAN'T COMPUTE COV, ERROR MESSAGE FROM MATLAB THAT IT IS TOO BIG
C = cov(mslpJune_dt_reshaped_trans);
[eigenvectors,eigenvalues] = eigs(double(C),2);
%Principal components
pcs = mslpJune_dt_reshaped*eigenvectors;
%Scaling pcs
pcs1_norm(:,1)=pcs(:,1)/std(pcs(:,1));
pcs2_norm(:,2)=pcs(:,2)/std(pcs(:,2));
Does anyone know how to fix this issue and compute the EOFs?
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!