Question: COPY and Paste The MATLAB code (15 points) Write an M-file to estimate the value of Art by generating a set of random locations within
COPY and Paste The MATLAB code

(15 points) Write an M-file to estimate the value of Art by generating a set of random locations within a grid as shown below. Assume that there is equal probability of any location being chosen, such that all randomly selected locations will occur within the area of the square. However, not all of the randomly selected locations will occur within the area of the circle. By looking at the ratio of the number of times you end up within the circle to the number of times you end up within the square, you can estimate the value of n. Using your M-file, display the estimated value of T. (Reference the equation below). # of points within circle Areasquare Length * Width total # of points square Area circle 14 -1 1 0 circle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
