I have a cell, Data
, it contains three double arrays,
Data =
[74003x253 double] [8061x253 double] [7241x253 double]
I'm using a loop to read these arrays and perform some functions,
for ii = 1 : 3
D = Data {ii} ;
m = mean (D') ;
// rest of the code
end
Which gets a warning for mean
and says:
consider using different DIMENSION input argument for MEAN
However when I change it to,
for ii = 1 : 3
D = Data {ii}' ;
m = mean (D) ;
// rest of the code
end
I get Out of memory error.
Comparing two codes, can someone explain what happens?
It seems that I get the error only with a Complex conjugate transpose (my data is real valued).
ii
before failure?'
has nothing to do with complex numbers - it transposes matrices which also means it needs to make a copy (needs extra ram). My guess is, since Matlab uses a very advanced just in time compiler, it recognizes the first cases and correctly replaces it withmean(D,2)
.'
is not the same as transpose.'
. The operator'
is actually the hermitian (complex) transpose.