i want to show the result in matrix form what is the command for that

1 回表示 (過去 30 日間)
mohit kumar
mohit kumar 2016 年 6 月 6 日
コメント済み: Star Strider 2016 年 6 月 6 日
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

回答 (1 件)

Star Strider
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 件のコメント
mohit kumar
mohit kumar 2016 年 6 月 6 日
this operation showing the same result 36 times
Star Strider
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 ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by