Effacer les filtres
Effacer les filtres

Problems with exp-functions

1 vue (au cours des 30 derniers jours)
Alexander Engman
Alexander Engman le 23 Jan 2016
Hi!
I want to make a function of x.
This is my code:
x=(0:0.001:5); %x-values
f=2*x*exp(-x);
plot(x,f)
But MatLab is telling me:
Error using *
Inner matrix dimensions must agree.
What does this mean in this case and how do I solve it?

Réponses (1)

Walter Roberson
Walter Roberson le 23 Jan 2016
f=2*x.*exp(-x);
  1 commentaire
Alexander Engman
Alexander Engman le 23 Jan 2016
Thanks, I figured it out!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB 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