필터 지우기
필터 지우기

Another way instead of for loop

조회 수: 1 (최근 30일)
muhammad ismat
muhammad ismat 2015년 6월 17일
편집: Walter Roberson 2015년 6월 17일
I have this code
for i = 1:34
for j = 1:i % <-- Note the 1:i instead of 1:n
s(i,j) = abs(z(i,ind(j))-z(j,ind(i)))/(z(i,ind(j))+z(j,ind(i)));
s(j,i) = s(i,j)
end
end
but it is very slow, so i want another way instead of for loop.
  댓글 수: 2
Christiaan
Christiaan 2015년 6월 17일
Dear Muhammad, What would you like to acchieve? Kind regards
muhammad ismat
muhammad ismat 2015년 6월 17일
i have a matrix 10 x 10
then i make a cluster to previous matrix then i want calculate eq
(z(i,ind(j))-z(j,ind(i)))/(z(i,ind(j))+z(j,ind(i)))
to each point in the matrix
where ind cluster no that a point belong to, z is the distance from point to a cluster

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by