- Those square brackets do nothing. Get rid of them.
- A loop is not required, you can trivially vectorize the distance calculation.
- You need to learn about the differences between array and matrix operations. When you read the error message it already gives advice to pay attention to this.
Error using ^ Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in Untitled (line 23) D(i) = sqrt ((a1(i)-a9)^2 +(b1(i)-b9)^2 + (c
1 view (last 30 days)
Show older comments
Hi everyone, can you help me overcome this problem?
1 Comment
Stephen23
on 11 Jul 2019
Edited: Stephen23
on 11 Jul 2019
Notes about your code:
See Also
Categories
Find more on Particle & Nuclear Physics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!