How do I find integral of a large function?
Show older comments
E = 0.5*M*u(:,3).^2 + 0.5*m*(u(:,3).^2+2*L*u(:,3).*u(:,4).*cos(u(:,2))) + ...
0.5*k* u(:,1).^2 + m*g*L*(1-cos(u(:,2)));
How i find integral of E(t) from 0 to 20

2 Comments
Walter Roberson
on 1 May 2021
There does not appear to be any t in the expression to be integrated?
Abdur Shishir
on 1 May 2021
Answers (1)
Jan
on 1 May 2021
A function, which is constant with respect to t, is integrated by multiplying its value by (tf - ti).
A = E * (tf - ti)
Does "I was told to integrate" really implies, that you have to use "t" as variable? Maybe you should integerate over u?
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!