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)
Hi everyone, can you help me overcome this problem?
  1 Comment
Stephen23
Stephen23 on 11 Jul 2019
Edited: Stephen23 on 11 Jul 2019
Notes about your code:

Sign in to comment.

Answers (1)

Stephen23
Stephen23 on 11 Jul 2019
Edited: Stephen23 on 11 Jul 2019
Using my trusty magical crystal ball:
a1 = 550;
b1 = 355;
c1 = 0.5676;
d1 = 1.3090;
a9 = Data(:,1);
b9 = Data(:,2);
c9 = Data(:,3);
d9 = Data(:,4);
D = sqrt((a1-a9).^2 + (b1-b9).^2 + (c1-c9).^2 + (d1-d9).^2)

Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!