Azzera filtri
Azzera filtri

for i = 1:nclass,%1 inx_i = find(class== Numclass(i));%2 Xki = Vector(:,inx_i);%3 Dki = DW(:,inx_i);%4 sum(Dki); %5 M(i,:)=sum(Dki*Xki');%6 meanclass(i) = Numclass(i); %7end in this code meaning of 3rd n 4th line, n can we use ',' after for

1 visualizzazione (ultimi 30 giorni)
for i = 1:nclass,%1
inx_i = find(class== Numclass(i));%2
Xki = Vector(:,inx_i);%3
Dki = DW(:,inx_i);%4
sum(Dki); %5
M(i,:)=sum(Dki*Xki');%6
meanclass(i) = Numclass(i); %7
end
in this code meaning of 3rd n 4th line, n can we use ',' after for loop? line number 6th means that every ith row of M will store sum of product of Dki and Xki ??

Risposta accettata

KSSV
KSSV il 21 Nov 2016
for i = 1:nclass,%1
inx_i = find(class== Numclass(i));%2
Xki = Vector(:,inx_i);%3 Extracting the column inx_i from matrix Vector
Dki = DW(:,inx_i); %4 Extracting the column inx_i from DW
sum(Dki); %5
M(i,:)=sum(Dki*Xki');%6 Dki*Xki' will be a matrix, sum(Dki*Xki') results into a array
meanclass(i) = Numclass(i); %7
end
% in this code meaning of 3rd n 4th line, n can we use ',' after for loop?
% line number 6th means that every ith row of M will store sum of product of Dki and Xki ??
I suggest you to run the code and use debugging option. When you put debugging point, your code will stop at the point and you can check the dimensions of every variable of the code. Read about debugging matlab code.

Più risposte (0)

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by