Getting "Matrix dimensions must agree." warning, please help.

x = -1:0.3:2
y = -(1/((x-0.3).^2+0.01)+1/((x-0.9).^2+0.04))
plot(x,y)
when i run the program, i get this error
??? Error using ==> mldivide
Matrix dimensions must agree.
Error in ==> O4P9 at 12
y = -(1/((x-0.3).^2+0.01)+1/((x-0.9).^2+0.04))
why is that, what should i do to be able to plot? please help.

 Respuesta aceptada

Add the necessary dots:
x = -1:0.3:2
y = -(1./((x-0.3).^2+0.01)+1./((x-0.9).^2+0.04))
plot(x,y)

Más respuestas (0)

Categorías

Más información sobre Polar Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 19 de Oct. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by