MATLAB Discover How to Find and Evaluate the Integral of sinx in MatLab

  • Thread starter Thread starter Ali Asadullah
  • Start date Start date
  • Tags Tags
    Integral Matlab
Click For Summary
To find the integral of sin(x) in MATLAB, use the symbolic variable with the command "syms x" to define x. The function can be defined using "fun = inline(sin(x))". To evaluate the definite integral from 1 to 2, the command "int = quad(fun, 1, 2)" is used. This approach allows for both symbolic and numerical integration of the sine function. Understanding these commands is essential for effectively using MATLAB for integral calculations.
Ali Asadullah
Messages
99
Reaction score
0
Please tell me the code or whatever we call it for finding the integral of sinx in MatLab?
Also how to evaluate definite integral from, say, 1 to 2?
 
Physics news on Phys.org
syms x
fun=inline(sin(x))
int=quad(fun,1,2)
 

Similar threads

Replies
6
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 44 ·
2
Replies
44
Views
6K