Borrar filtros
Borrar filtros

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 visualización (últimos 30 días)
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 ??

Respuesta aceptada

KSSV
KSSV el 21 de Nov. de 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.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by