i want to show the result in matrix form what is the command for that
2 次查看(过去 30 天)
显示 更早的评论
D=sqrt((Px(i)-Px(j))^2+(Py(i)-Py(j))^2); i want to see the result of this operation in matrix format please provide me the instruction to do that
0 个评论
回答(1 个)
Star Strider
2016-6-6
Assuming this is inside two nested for loops, subscript ‘D’:
D(i,j) = sqrt((Px(i)-Px(j))^2+(Py(i)-Py(j))^2);
2 个评论
Star Strider
2016-6-6
It’s your data and only one line of your code. All I did was subscript the ‘D’ assignment to create a matrix.
I have no control over your data or the logic in your loop.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!