Numerical Integration - Constant Increment The area under a curve can be estimated by breaking the x axis into increments, evaluating the function at a point inside that increment, and approximating the area under the curve in that increment as a rectangle. The figure below shows this approximation with an increment of 1 and the function being evaluated at the midpoint of the increment. 20 18 L 1.5 2 16 14 12 10 8 6 4 Script Given a range (upper and lower limits) and increment, use the midpoint approximation as shown above to estimate the area under the curve: y = x² + 2x In(x) You can assume that the increment given will evenly divide the range. 2.5 - 3 35 1 %% Variables to be used 2% Inputs 3% Xmin the minimum limit of the range 4% Xmax the maximum limit of the range. 5% inc the increment for the numerical approximation 6 7 % Outputs Save C Reset My Solutions > 8% area the final approximation of the area under the curve for the given range 9 10 %% Inputs 11 % This generates the scalars, Xmin, Xmax, and inc, with random values which will be used to evaluate your code 12 Xmin=randi(10)+1 13 inc=randi (3) 14 Xmax=Xmin+inc*(randi(8)+2) 15 16 %% Program 17 % Start writing your program here. MATLAB Documentation.
Numerical Integration - Constant Increment The area under a curve can be estimated by breaking the x axis into increments, evaluating the function at a point inside that increment, and approximating the area under the curve in that increment as a rectangle. The figure below shows this approximation with an increment of 1 and the function being evaluated at the midpoint of the increment. 20 18 L 1.5 2 16 14 12 10 8 6 4 Script Given a range (upper and lower limits) and increment, use the midpoint approximation as shown above to estimate the area under the curve: y = x² + 2x In(x) You can assume that the increment given will evenly divide the range. 2.5 - 3 35 1 %% Variables to be used 2% Inputs 3% Xmin the minimum limit of the range 4% Xmax the maximum limit of the range. 5% inc the increment for the numerical approximation 6 7 % Outputs Save C Reset My Solutions > 8% area the final approximation of the area under the curve for the given range 9 10 %% Inputs 11 % This generates the scalars, Xmin, Xmax, and inc, with random values which will be used to evaluate your code 12 Xmin=randi(10)+1 13 inc=randi (3) 14 Xmax=Xmin+inc*(randi(8)+2) 15 16 %% Program 17 % Start writing your program here. MATLAB Documentation.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Language is Matlab
![Numerical Integration - Constant Increment
The area under a curve can be estimated by breaking the x axis into increments, evaluating the function at a point inside that increment, and approximating the area under the
curve in that increment as a rectangle. The figure below shows this approximation with an increment of 1 and the function being evaluated at the midpoint of the increment.
20
y
18
16
14
12
> 10
8
6
4
0
0.5
1
Script>
1.5
1
2
X
2.5
3
3.5
Given a range (upper and lower limits) and increment, use the midpoint approximation as shown above to estimate the area under the curve:
x² + 2x
In (x)
You can assume that the increment given will evenly divide the range.
4
1% Variables to be used
2% Inputs
3 % Xmin the minimum limit of the range
4% Xmax - the maximum limit of the range
5 % inc the increment for the numerical approximation
Save
C Reset
My Solutions >
6
7 % Outputs
8% area - the final approximation of the area under the curve for the given range
9
10% Inputs
11% This generates the scalars, Xmin, Xmax, and inc, with random values which will be used to evaluate your code
|12 Xmin=randi(10)+1
13 inc=randi(3)
14 Xmax=Xmin+inc×(randi(8)+2)
15
16 % Program
17% Start writing your program here
MATLAB Documentation](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbcfa3f98-eb44-4f4d-86d7-8c297108b84f%2F6eb11f7d-0612-4449-be91-84a17d42ca8a%2F5pyrnff_processed.png&w=3840&q=75)
Transcribed Image Text:Numerical Integration - Constant Increment
The area under a curve can be estimated by breaking the x axis into increments, evaluating the function at a point inside that increment, and approximating the area under the
curve in that increment as a rectangle. The figure below shows this approximation with an increment of 1 and the function being evaluated at the midpoint of the increment.
20
y
18
16
14
12
> 10
8
6
4
0
0.5
1
Script>
1.5
1
2
X
2.5
3
3.5
Given a range (upper and lower limits) and increment, use the midpoint approximation as shown above to estimate the area under the curve:
x² + 2x
In (x)
You can assume that the increment given will evenly divide the range.
4
1% Variables to be used
2% Inputs
3 % Xmin the minimum limit of the range
4% Xmax - the maximum limit of the range
5 % inc the increment for the numerical approximation
Save
C Reset
My Solutions >
6
7 % Outputs
8% area - the final approximation of the area under the curve for the given range
9
10% Inputs
11% This generates the scalars, Xmin, Xmax, and inc, with random values which will be used to evaluate your code
|12 Xmin=randi(10)+1
13 inc=randi(3)
14 Xmax=Xmin+inc×(randi(8)+2)
15
16 % Program
17% Start writing your program here
MATLAB Documentation
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY