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...
icon
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY