how to estimate/evaluate the integral of a constant value function?
Ältere Kommentare anzeigen
For example, f = 5, for 0<t<1, zero otherwise.
i tried the following code but it didn't work:
syms t
f = 10;
int(f)
Akzeptierte Antwort
Weitere Antworten (1)
Just Manuel
am 23 Feb. 2021
Try this:
syms t
f = 0*t + 10;
int(f);
Cheers Manuel
3 Kommentare
Jinquan Li
am 23 Feb. 2021
Just Manuel
am 23 Feb. 2021
Bearbeitet: Just Manuel
am 23 Feb. 2021
you can't use piecewise in a numerical context. redefine your function as follows:
f = @(t) 5 .* (t > 0 & t < 1);
% then you can calculate numerical integral like this
integral(f, -1, 1)
Cheers
Manuel
Jinquan Li
am 23 Feb. 2021
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
