필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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 ??

채택된 답변

KSSV
KSSV 2016년 11월 21일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by