Filter löschen
Filter löschen

false plot problem on curve bell plot

1 Ansicht (letzte 30 Tage)
Ugur Sahin
Ugur Sahin am 18 Mär. 2020
Beantwortet: Ugur Sahin am 18 Mär. 2020
Hi guys,
I am trying to print a bell curve function but equation that wrote doesn't show a graph truly in range ı defined could someone help me ? true bell curve plot is diffrent than matlab plot true and false plot compare here;
equation = (1/(sqrt(2*pi)))*(eps.^((-(x.^2))/2)); %% this is bell curve equation;
and also;
n=1:100;
sequence = 0.1*n;
x=[sequence];
y=(1/(sqrt(6.28)))*(eps.^((-(x.^2))/2));
plot(x,y);

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 18 Mär. 2020
Bearbeitet: Ameer Hamza am 18 Mär. 2020
In MATLAB, exp is the function for exponential of e, not eps. Try this,
x = linspace(-5,5,100);
y=(1/(sqrt(6.28)))*(exp(-(x.^2))/2);
plot(x,y);

Weitere Antworten (1)

Ugur Sahin
Ugur Sahin am 18 Mär. 2020
thank you so much :D

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by