Question: (Matlab) Convert the code below (Area Calculation) into the functions as described below: (2) Area calculation with slices of rectangles function [AreaSim]=rect_area(Curve, Range, NOR) wherein

(Matlab) Convert the code below (Area Calculation) into the functions as described below:

(2) Area calculation with slices of rectangles

function [AreaSim]=rect_area(Curve, Range, NOR)

wherein the function output AreaSim is the area calculated, the inputs Curve is the equation of the curve, Range is the starting and ending value, NOR is the number of rectangles you used to calculate.

%------------------------------------------------------%

N=10000;

Landed=0;

for i=1:N

x=rand()*16;

y=rand()*10;

if(y<2*sqrt(x)+1)

Landed=Landed+1;

end

end

area=10*16*(Landed/N)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!