Question: Write a GUI implemented in MATLAB using App Designer that calls the three functions in Tasks 1 3 . tasks are based on Buffon s

Write a GUI implemented in MATLAB using App Designer that calls the three functions in Tasks 13. tasks are based on Buffons needle experiment.
for example this is task one :
"function [p, crossings]= BuffonStandardPi(width, length, throws)
crossings =0;
for n =1:throws
% Randomly place the needle's midpoint and angle
midpoint = width * rand();
angle = pi * rand();
% Calculate the distance from the midpoint to the nearest line
distance_to_line = min(midpoint, width - midpoint);
% Check if the needle crosses a line
if distance_to_line <(length/2)* sin(angle)
crossings = crossings +1;
end
end
% Estimate pi using the crossings
if crossings >0
p =(2* length * throws)/(width * crossings);
else
p = Inf; % If no crossings, the estimate of pi goes to infinity
end
end"
The GUI must
1. Allow the user to select which task is run.
2. Allow the user to adjust the number of needles, dropped squares, and parallel planks of wood, from default values. The program should allow
at least 1,000,000 needles/dropped squares and 10 parallel planks of wood. Note: not all needles need to be displayed if more than 1000 are
dropped.
3. Before running the simulation allow the user to adjust the sizes of the needles, dropped squares, and parallel planks of wood from default
values.
4. Display the parallel planks of wood.
5. Display the dropped needles/squares.
6. Highlight in a different colour all needles/dropped squares that intersect the cracks between planks.
7. Display the value estimated by the Monte Carlo simulation.
8. Allow the user to customize elements of the displayed value (e.g. font size, colour).
9. an additional function to be applied to Task 1 needle dropping only:
It should allow the user to select a needle by clicking on or near it with the mouse. The needle will then be highlighted in a different colour and The n needles with most similar orientation will then be highlighted in yet another colour. The default value is n =3, and the value of n can
be modified through the GUI.
10. Allow a mixture of different sized needles to be used.
11. Support saving and loading back sets of needles such that previous results can be combined to produce better estimates.

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!