Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find the area under the curve given by y = c o s ( x ) + 1 ( i . e . above the

Find the area under the curve given by y=cos(x)+1(i.e. above the x axis) for |x|1.
Use 1000 random samplings of the rectangular area set by |x|1 and 0y2.
Name your vectors x and y to make it possible for the MATLAB Grader to check your solution.
Your script must be vectorized. Do not use for-loops.
Provide the following two quantities:
Na= the number of points that have landed under the curve (do not count the points that land directly onto the curve);
Sa= the area under the curve.
Script o.
N=1000;
x=2**rand(1,N)-1;
y=(rand(1,N))**2;
f=cos(**x)+1;
under_curve Na=Sa=4**NaN=y;
Na= sum(undercurve);
Sa=4**NaN;
disp(['Numberof points under the curve: ' num2str(Na)]);
disp(['Estimated area under the curve: ' num2str(Sa)]);
disp(['x=[' num2str(x')']'';']);
disp(['y=[' num2str(y')']'';']);
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

More Books

Students also viewed these Databases questions