Search code examples
matlabmathintegral

How to find integral in MATLAB?


How should I calculate the following integral in Matlab?

click to open image


Solution

  • fun = @(x) (2*x -1).^(1/3)
    ans = integral(fun,5,13)
    

    In case this doesn't work try this

    fun = @(x) (2*x -1).^(1/3)
    quadgk(fun,5,13) 
    
    ans =
    
       20.3924
    

    write the function. calculate integral