matrix decision

3 views (last 30 days)
Daniel
Daniel on 21 Mar 2012
I'm trying to write a simple code, but I get error "Error Using==> mldivide" "Matrix dimensions must agree".....
what am i doing wrong?:
d=1000:1:20000;
y1=14400/d;%estimation
y2=(0.0001759/(d^2))*(2-2*cos(9046/d));%exact
plot(d,y1,'r');
hold on;
plot(d,y2);

Accepted Answer

David Young
David Young on 21 Mar 2012
I think you need
y1=14400./d;%estimation
y2=(0.0001759./(d.^2)).*(2-2*cos(9046./d));
but I see this gives a very big difference between y1 and y2 so I'm not sure if it's entirely right.
  1 Comment
Daniel
Daniel on 21 Mar 2012
thanks, actually this solution worked just fine.
-Lee

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!