Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to use int function in matlab
How to use int function in matlab
The integral is calculated by, for example, integrating 5/((x- 1)(x-2)(x-3) from 4 to 5.

Input program in MATLAB

& gt& gt symbol x% defines symbol.

>>F = 5/((x-1) * (x-2) * (x-3))% defines the integrand function.

f = 5/(x- 1)/(x-2)/(x-3)

>>F = int (f, x, 4, 5)% Find the definite integral of the function f on the symbolic variable x from 4 to 5.

Symbolic solution of f = 25/2 * log (2)-15/2 * log (3)% definite integral

>>y = numerical (f)% converts symbolic solution into numerical result.

y = 0.4247