this is my equation using matlab , i can't get it manually.
1 次查看(过去 30 天)
显示 更早的评论
dmat = reshape(sqrt(sum((xy(a,:)-xy(a',:)).^2,2)),N,N);
5 个评论
采纳的回答
njj1
2018-4-19
编辑:njj1
2018-4-19
This looks like it's the distance from each (x,y) pair to every other (x,y) pair.
A_{i,j} = \sqrt{(x_i - x_j)^2}, where x = (x,y)
4 个评论
njj1
2018-4-19
Yes, it is, but they do it in a clever, vectorized way, where they do not have any for loops to cycle through each i,j.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!