matrix decision

12 visualizaciones (últimos 30 días)
Daniel
Daniel el 21 de Mzo. de 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);

Respuesta aceptada

David Young
David Young el 21 de Mzo. de 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 comentario
Daniel
Daniel el 21 de Mzo. de 2012
thanks, actually this solution worked just fine.
-Lee

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by