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

9 vues (au cours des 30 derniers jours)
Emre
Emre le 19 Oct 2011
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.

Réponse acceptée

Grzegorz Knor
Grzegorz Knor le 19 Oct 2011
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)
  1 commentaire
Emre
Emre le 19 Oct 2011
Thanks, i have serious problems with these dots :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by