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

  • Context: MATLAB 
  • Thread starter Thread starter Ali Asadullah
  • Start date Start date
  • Tags Tags
    Integral Matlab
Click For Summary
SUMMARY

This discussion focuses on calculating the integral of the sine function using MATLAB. The user inquires about the specific code required to find the integral of sin(x) and evaluate the definite integral from 1 to 2. The solution provided includes using symbolic variables with 'syms x', defining the function with 'fun=inline(sin(x))', and computing the integral using 'int=quad(fun,1,2)'. This method effectively demonstrates how to perform numerical integration in MATLAB.

PREREQUISITES
  • Familiarity with MATLAB syntax and environment
  • Understanding of symbolic mathematics in MATLAB
  • Knowledge of numerical integration techniques
  • Basic concepts of calculus, specifically integration
NEXT STEPS
  • Explore MATLAB's 'integral' function for numerical integration
  • Learn about symbolic integration using 'int' function in MATLAB
  • Investigate the differences between 'quad' and 'integral' functions in MATLAB
  • Study the use of 'syms' for defining symbolic variables in MATLAB
USEFUL FOR

Students, educators, and professionals in mathematics, engineering, or any field requiring numerical analysis and integration using MATLAB.

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
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · 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
7K