covariance calculation of a square matrix of any size

2 visualizaciones (últimos 30 días)
x
x el 3 de Sept. de 2011
Comentada: Hemal el 30 de Oct. de 2013
if cov command is directly aplied to a cameraman image for 3 by 3 matrix .the o/p is not obtained ???
156 159 158
160 154 157
156 159 158
Error using ==> bsxfun Mixed integer class inputs are not supported.
Error in ==> cov at 93 xc = bsxfun(@minus,x,sum(x,1)/m); % Remove mean
Error in ==> Untitled at 12 d=cov(g);
what will be the reason

Respuestas (1)

Walter Roberson
Walter Roberson el 3 de Sept. de 2011
cov() only works on floating point inputs. Use cov(double(g))

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by