Asked by abdo
on 25 Nov 2012

i'm trying to insert an equation and plot it, but i couldn't because i keep getting errors like : matrix dimensions must agree, or inner matrix dimensions must agree.

http://www4.0zz0.com/2012/11/25/10/272913238.png

this is the equation. M has a value of 1 to 5 with an increment of 0.5. Q has a value of 0 to 1 with an increment of 0.1.

the plot is something like this.

http://www4.0zz0.com/2012/11/25/10/700692428.png

thank you in advance, i would appreciate your help

*No products are associated with this question.*

Answer by moulay
on 25 Nov 2012

Hi!

that is true. length(M)=9 and length (Q)=11. you should take the same length of both vectors. for example Q=0:0.1:0.8!

abdo
on 25 Nov 2012

Answer by bym
on 25 Nov 2012

use the dot notation to specify element-by-element multiplication/division/exponentiation as in:

d= q./(2*m)-acos(sqrt(1-(q./m).^2))

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments