MATLAB Answers

How to be able to plot all the data in Matrix and the the mean of matrix in Matlab?

14 views (last 30 days)
Tanya
Tanya on 17 Feb 2014
Commented: Tanya on 17 Feb 2014
I want to plot my data for PCA.
For ex/ I have 100*50 matrix.
Im now sure, but may be we can consider the column as the features (features = 50).
And for the row, I may be the training data.
So we have 100 training data/image. And I also have mean from my initial matrix.
So, now, Im going to plot each data(100) for every feature (50) and also the mean at the same figure.
Can u please help me solve this Master ;)
I really appriciate any help
  2 Comments
Tanya
Tanya on 17 Feb 2014
Hii..
Here is my code
[a,InputMatrix] = sort(rand(100,50)); %ROW=100 COLUMNS=50
Average=mean(InputMatrix);
[CovarianceMatrix]= cov(InputMatrix);
[EigVector,EigValue] = eigs(CovarianceMatrix);
From that code, I have 100 rows and 50 columns.
Im going to do PCA for mechine learning.
So I have to reduce the dimensionality of my data (in this case represents by a matrix).
I dont know exactly what is column and row of matriks represent as. But I guess, the Column will be as the kind of features and the Row will be the training data.
I already calculate the mean of my input matrix. And the are eigenvector 1 & eigenvector2. Which are the first and second colomn of EigVector
And know, I have to visualize my matrix, the mean, and the eigenvector (as a line) in 2D space in the same figure (at one figure).
How to do that??

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!