assistance with ezplot function

6 vues (au cours des 30 derniers jours)
Bob
Bob le 15 Sep 2012
Hello,
I am having trouble with the ezplot function. I want to plot the following:
lambda=1;
a=.3238;
ezplot((1/sqrt(2*pi*a))*exp(-.5*((x-1-lambda*a)^2)/a), [-1,3])
But I am getting an error message.
If someone could look into this I would appreciate it. Thanks.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 15 Sep 2012
Modifié(e) : Azzi Abdelmalek le 15 Sep 2012
ezplot('(1/sqrt(2*pi*.3238))*exp(-.5*((x-1-1*.3238)^2)/.3238)', [-1,3])
% you are using ‘ ’ instead of ' '
%or if you want use variables a & lambda
lambda=1;
a=.3238;
fh = @(x,a,lambda) (1/sqrt(2*pi*a))*exp(-.5*((x-1-lambda*a)^2)/a)
ezplot(@(x) fh(x,a,lambda),[-1,3])
  1 commentaire
Bob
Bob le 15 Sep 2012
Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by