Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Optimizing code: various distance

조회 수: 2 (최근 30일)
nedo nodo
nedo nodo 2013년 1월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi all,
Is there a way to improve the performance of the following code?
D=zeros(size(X,1),size(Y,1));
for l=1:size(X,1)
D(l,:)=sum((abs(bsxfun(@minus,Y,X(l,:))).^p),2).^(1/p);
end
Thank you in advance

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by