LDA error Sum(Double(Group));

1 view (last 30 days)
Lester Lim
Lester Lim on 17 Jan 2013
Hi, I need hlp in continuing this program. No matter what variable I put into it it always gives the same error...
if (nargin >= 3) PriorProb = Priors; end %Against different classes for i = 1:k,% Loop over classes to perform intermediate calculations % Establish location and size of each class Group = (Target == ClassLabel(i)); nGroup(i)= sum(double(Group));** % Calculate group mean vectors GroupMean(i,:) = mean(Input(Group,:)); % Accumulate pooled covariance information PooledCov=PooledCov+((nGroup(i)-1)/(n-k)).* cov(Input(Group,:)); end
Error: In an assignment A(I) = B, the number of elements in B and I must be the same.
ERROR-nGroup(i)= sum(double(Group));

Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!