If we have a data set consisting of N data pairs: x n ,y n there will be N-1 intervals between data pairs. In the above diagram, the lessor of the two edges has been selected for the y value of the...

1 answer below »

If we have a data set consisting of N data pairs: xn,ynthere will be N-1 intervals between data pairs.


In the above diagram, the lessor of the two edges has been selected for the y value of the rectangle, and the width of the rectangle is xn-1– xn


We can therefore write the estimated area as:





Write a MATLAB function and save a file with name Area 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


Identify how many data points have been provided in array x.
Initialize the estimated area variable to zero.

Use a for loop which counts n from 1 to (data point count -1)


Determine width of rectangle
Determine height of rectangle
Calculate the area of the rectangle
and add to estimate for area

end

Return the estimated area



Using the MATLAB editor, create a script m-file for the following:



Read thedata fileand assign values to arrays.
Create a x-y scatter plot of the data with title and labels.
Calculate the estimated area under the curve.
Present the estimate of area





xy -121.2 -11.927274512.097829333 -11.848071753.066598706 -11.766119214.0590966 -11.683008435.055332765 -11.610784285.912658324 -11.533140526.825589192 -11.452471367.76451438 -11.377822988.624666906 -11.302612639.482841516 -11.2334686810.26431069 -11.15924711.09518802 -11.0760072712.01718798 -10.9955901712.89805258 -10.920922913.70725049 -10.8507085714.46056067 -10.7698719515.3186766 -10.70047516.04753605 -10.6136857516.94889634 -10.5271491317.83638353 -10.4415871718.70283122 -10.3727728519.39171553 -10.3032452520.08052636 -10.2332795420.76635781 -10.1586399321.48990971 -10.0797849722.24524709 -9.99945845323.00509033 -9.92488094323.70188698 -9.85232650924.37177522 -9.77034309825.11921816 -9.68545498825.88251919 -9.60554688426.59116434 -9.53134353827.24064159 -9.44590148427.97825718 -9.3589886928.71733469 -9.28999874929.29593543 -9.20264664730.01829224 -9.12516828530.64942022 -9.05066952231.24778522 -8.97195031131.87100246 -8.89780960132.44947199 -8.82237475733.02957637 -8.74944236933.58232094 -8.66479848934.21382189 -8.57877967934.84457062 -8.50199998735.39819709 -8.42081463235.97397264 -8.34973536736.46995753 -8.26986971637.01821157 -8.19337732337.53433904 -8.11341242638.06451369 -8.04319533338.52215049 -7.95788202739.06822458 -7.88653136639.51654291 -7.81304069739.9703242 -7.73502522740.44317982 -7.64895604640.95425741 -7.57217778241.40078831 -7.49551392641.83783122 -7.40833997842.32407795 -7.32606833342.77252475 -7.24975880643.17939725 -7.16907335443.60010122 -7.08107236944.04781585 -7.00683371944.41647975 -6.9280336144.79875094 -6.85434218845.14781113 -6.76749270645.54874101 -6.68440131945.92173164 -6.60599391346.26419923 -6.53037569646.58574885 -6.45517320746.89702411 -6.38074531447.19674069 -6.29923173547.51545738 -6.22019567747.8149701 -6.14590033748.08797367 -6.05890046348.39713648 -5.97516502748.68397633 -5.90239507748.9247117 -5.82003511649.18759008 -5.74912362949.40577545 -5.67254802949.63291811 -5.59542435549.8527961 -5.51715938350.0668068 -5.4484149750.24720457 -5.37487274750.4323446 -5.28981801850.6363499 -5.2164969550.8035026 -5.1417730650.96555649 -5.06956975851.1141875 -4.99344639551.26241964 -4.91205122951.41130143 -4.82782140751.55490523 -4.74702704451.68265213 -4.6783321151.78356632 -4.6014281751.88814185 -4.53177169651.97520547 -4.44496099652.07352289 -4.3647967352.15427382 -4.29071912952.22032414 -4.20717765252.284937 -4.12460571852.33851277 -4.03733252852.3840217 -3.95097689252.41780679 -3.87577351352.43811643 -3.79243792252.45071332 -3.71819595352.45316148 -3.6367346952.44633486 -3.55425368452.42928119 -3.4818440152.40589817 -3.41003661852.37494276 -3.33485709252.33424585 -3.24990037852.27805277 -3.17329340752.21809979 -3.09199806452.14485014 -3.0064330152.05704527 -2.92684977751.96552154 -2.83908925451.85357898 -2.75421460551.73432822 -2.67025752151.6057357 -2.58522797551.4647239 -2.51055265351.33193889 -2.43819660251.19529897 -2.35648101151.0315416 -2.27645969350.86147273 -2.20120028550.69275958 -2.12989236650.52506613 -2.04251872950.30919281 -1.95995698150.09468557 -1.87191795649.85468293 -1.80190506849.65552197 -1.72580674749.43071109 -1.64862675749.1938322 -1.56864973848.93894203 -1.48892594748.67530995 -1.41006441348.40514948 -1.32786846248.1136374 -1.25101806547.83191652 -1.17703186347.55232543 -1.1077682747.28313941 -1.03765779147.00333336 -0.96256614346.69547021 -0.87963870246.34565354 -0.80991543846.04355419 -0.72959548945.68650255 -0.65254696645.33489985 -0.57122163544.95412054 -0.48918272444.55994845 -0.40968364644.1683479 -0.33313533343.7823235 -0.25978770143.40419389 -0.17653472742.96522109 -0.09648450942.53333131 -0.01000821242.05597087 0.05926651841.66547311 0.13918988141.2060063 0.21037283940.78871955 0.27993133140.37361338 0.35930087339.89109228 0.44088302939.38527165 0.51587186438.91152473 0.59342663538.41269447 0.66311762137.95674759 0.73751349337.46197982 0.82077000636.89844041 0.90429812836.32261415 0.98517587735.75508646 1.05766782235.23806428 1.13484653734.67895189 1.20628018234.15349708 1.29308206933.50469448 1.37773003932.86110674 1.4644350532.19073621 1.54709018231.54117895 1.62272924830.93777855 1.70860102130.2423462 1.77987071329.65676919 1.86529775228.94483081 1.94412490928.27818427 2.02025062227.62553709 2.09516349526.97480187 2.16428701626.366889 2.24558844125.64270415 2.3174270324.9945576 2.3949056124.28684892 2.47669459923.52999814 2.55019561822.84128127 2.63101640922.0746226 2.70762023421.33892119 2.79438661620.49498754 2.87343135819.71632857 2.94541200718.99910385 3.01948310818.25293592 3.10618997917.36902398 3.19382038616.46423934 3.28154158915.54698071 3.36084510414.70780756 3.44664666113.78924879 3.52838450812.90392383 3.60672942912.04594231 3.67596838711.28001934 3.711.0125
Answered Same DayMay 22, 2021

Answer To: If we have a data set consisting of N data pairs: x n ,y n there will be N-1 intervals between data...

Manoj answered on May 23 2021
137 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here