M-files to solve numerical integration

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
mazi
Messages
2
Reaction score
0

Homework Statement



Numerical integration using MATLAB m-files
Find the area under the curve of:
using trapezium rule

Homework Equations



g(x) = x^2 from x=0 to x=2
Area of a trapezium = h/2(a+b)

The Attempt at a Solution

 
Physics news on Phys.org
I am actually trying out something. it is not my homework and i have no idea since i am new to MATLAB software. can't figure out how to program the mfile
 
You can use the command "trapz", look it up in the help files. It integrates a numerical sequence using the trapezoidal rule.
 
Last edited: