Question: Create a local user defined function, UBArea which will estimate the area from a data set: Arguments to the function will be: an array of
Create a local user defined function, UBArea which will estimate the area from a data set:
Arguments to the function will be:
an array of x values and
an array of y values
Calculations
Within the function, identify how many data pairs have been provided.
Use a for loop to calculate the area of each rectangle and sum the areas to estimate to total area under the curve.
Return the estimated area
Define a piecewise continuous function, MYFunction such that:
Arguments:
X
Calculations:
If X is less than or equal to
mathrmYmathrmX
If X is greater than but less than or equal to
mathrmYmathrmXwedge
If X is greater than
mathrmYstarmathrmX
Return the value of Y
Using the MATLAB editor, create a script m file for the following:
Define a variable K with values assigned over the range to
Define: J MYFunctionK
Estimated area under the MYFunction curve accurate to significant digits
Begin by assigning mathrmN number of data points to be created
Assign preset value to UpperBound
Assign preset value to LowerBound
Using a while loop
while UpperBound LowerBound
Assign values to K
Calculate values for J
Calculate the UpperBound UBAreamathrmKmathrmJ and LowerBound LBAreamathrmKmathrmJ
Round the UpperBound and LowerBound to significant digits
Increase number of data points N by
end
Create a xy scatter plot of the KJ data with title and labels.
Present the estimate of area
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
