Matlab's quad equals 0 when over 0 to 6 and actual value over 3 to 5
Mostra commenti meno recenti
Thank you for reading.
I am to use Matlab's quad to find the integration of a function over 0 to 6. Using quad over that region I get the value 0, which is incorrect. If I try quad over 3 to 5 it gives me the actual value, which is around 0.2836.
format long
y = @(x) 80.*(exp(-((x-pi)./0.002).^2))
s_int = quad(y,0,6)
x = 0:10^(-5):6;
y = 80.*(exp(-((x-pi)./0.002).^2));
plot(x,y)
axis([ 3.13 3.15 0 100 ])
I plot the function to make sure it's correctly typed into Matlab.
What's going on here and how can I correct this?
Thank you / Herje
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Adaptive Control in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
