how to find the covariance matix & eigen value

In my project i implementing the PCA for an image i need to find the eigen vectors for an image using PCA. if it there any inbuilt function to find the covariance/correlation, eigen value, eigen vectors, how to find the coordinates of each data point of principal components

Respuestas (2)

Walter Roberson
Walter Roberson el 22 de Feb. de 2013

0 votos

cov(), eig()

1 comentario

ajith
ajith el 22 de Feb. de 2013
if i apply directly the pca function pca() .if it possible to know the covariance, eigon vectors

Iniciar sesión para comentar.

Shashank Prasanna
Shashank Prasanna el 22 de Feb. de 2013

0 votos

The 'coeff' contains the eigen vectors of the covariance matrix and 'latent' has the eigen values of the covariance matrix. your 'coordinates of each data point of principal components' is the score.
I recommend you read the documentation of PCA to understand what the outputs mean:
But what is your intention? you can use cov and eig as walter mentioned to find the covariance and its eigen vectors and this is an intermediate step in performing PCA.

4 comentarios

ajith
ajith el 22 de Feb. de 2013
Editada: ajith el 22 de Feb. de 2013
x=double(imread('result.png'));
>> [coeff,score,latent]=pca(x);
??? Undefined function or method 'pca' for input arguments of type 'double'.
sir,how to resolve the error
Shashank Prasanna
Shashank Prasanna el 22 de Feb. de 2013
Pca was introduced in a recent release. If you have an older release of MATLAB, you should use PRINCOMP. Which does the same. Read the documentation to understand how it performs the pca computations.
ajith
ajith el 28 de Feb. de 2013
x=double(imread('result.png'));
[pc, zscores, pcvars] = princomp(x);
it shows
>> Empty state-space model.
how to resolve it
Shashank Prasanna
Shashank Prasanna el 28 de Feb. de 2013
Editada: Shashank Prasanna el 28 de Feb. de 2013
Do you have the statistics toolbox? because princomp and pca are only available in the statistics toolbox. You can check that by typing 'ver' on the commandline.
Start fresh
>> clear all
and then execute princomp(x), copy-paste the exact error message you see from the command line if you see an error.
What is the output of :
>> which -all princomp

Iniciar sesión para comentar.

Categorías

Preguntada:

el 22 de Feb. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by