To evaluate the integral analytically using MATLAB, you can use the symbolic integration function int()
.
Here is the MATLAB code to evaluate the integral:
main.m235 chars7 lines
Running this code will give you the value of the integral, which is approximately 7.2566.
Make sure you have the Symbolic Math Toolbox installed in MATLAB in order to use symbolic integration functions.
gistlibby LogSnag