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

2 Ansichten (letzte 30 Tage)
mohit kumar
mohit kumar am 6 Jun. 2016
Kommentiert: Star Strider am 6 Jun. 2016
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

Antworten (1)

Star Strider
Star Strider am 6 Jun. 2016
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 Kommentare
mohit kumar
mohit kumar am 6 Jun. 2016
this operation showing the same result 36 times
Star Strider
Star Strider am 6 Jun. 2016
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by