-1

A training set of 2000 samples ( value :2000 * 2 ) named training_set. how can i estimate the mean and covariances for all classes from training set. already tried mean and cov function.but every time get " Undefined function or variable " error. Just a beginner. thanks in advance.

1 Answers1

0

Okay. You have row vectors and the mean would be a row vector as well.

Matlab: training_mean = mean(training_set,1);

the cov function in matlab should work fine and your result should be a 2 by 2 matrix. Matlab has good documentation for this kind of things.

  • tried this way...but still undefined function or variable

    training_mean = mean(training_data,1);

    – user3341165 Dec 02 '14 at 13:19
  • is your data composed of row vectors? or make sure it is. try this on matlab command prompt. create a matrx A = ones(3,2). compute the mean with mean(A,1)--> which is row mean or mean(A,2)--> which is a mean of columns – Girum Demisse Dec 02 '14 at 13:20