Question: Problem 1: Write a function in Matlab that fit randomly chosen circular disk of various radius with centers at random locations within in a box

 Problem 1: Write a function in Matlab that fit randomly chosen

Problem 1: Write a function in Matlab that fit randomly chosen circular disk of various radius with centers at random locations within in a box of dimensions: length = L and height -H. Disk radius are integers randomly choosen from {1,2,3, ..., max_rad} where . max rad is a user-defined parameter. * Disk centers are randomly located at integer coordinates within the box. None of the disk should overla All disk should be contained within the boundarv of the box * You can assign different colors to disks with different radius when plotting the results. Your function should try to fit as many disks as possible within the domain: L H * Your function should plot the disks and should return the data, i.e. radius and centers, * You can used matlab function randi () to generate random numbers The best code will be able to fit the most # of disks. of the plotted disks. e.g. xc- randi (L) will gave a random integer between 1 and L; e.g. yc randi (H) will gave a random integer between 1 and H; e.g. rad- randi (max rad) will gave a random integer between 1 and max rad; * Try to make your function as robust as possible. Test various cases! function radius,centers -Ilt disks (L,H, max rad,max num % Inputs % L-> Length of box % H-> Height of box % max rad-> maximum radius of disk % max num -> maximum number of disk to be fitted % Note: Your function might not be able to fit the max num specified The goal is to fit as many disk as possible. You need to build some reasonable logic to accomplish this task You can add more inputs/outputs if necessary end

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!