Question: Matlab %names_pl - a cell array storing the names of each planet %rad - an array of doubles storing the radius of each planet in
Matlab
%names_pl - a cell array storing the names of each planet
%rad - an array of doubles storing the radius of each planet in miles
%orb - an array of each planet's orbit in days
%temp - an array of each planet's equilibrium temperature in Kelvin
%dist - an array of the distance from each planet to its sun in
%units of Solar Radius
rad_earth=3959; %miles
rad_superearth=2*rad_earth; %miles
rad_neptune=15299; %miles
rad_jupiter = 43441; %miles
write a binning algorithm.
You are going to categorize the exoplanets into five bins: smaller than Earth, Super Earth Size (1-2 times Earth Size), smaller than Neptune, smaller than Jupiter, bigger than Jupiter. The units of the spreadsheet data are Rjupiter(i.e. if the radius is 2, the planets radius is 2 times the radius of Jupiter). Each planet should be binned only once. Make a bar graph of the five bins and label properly. You may not use an if statements or loops, use only array operations. Fill in the quantity of each of the above conditions to each index of the bin array. Your bar graph should look like this (this was done with the inclusive condition at the max end of the range, and exclusive conditions at the min end of each range, i.e. "smaller than or equal to earth', ' larger than earth and smaller than or equal to super earth'):
%%Part 1 - Bin planets by size
bin=zeros(1, 5); %initialiing the arrays of bins
%(1)the first index should hold number of planets with
%a radius less than or equal to the earth's radius
%(2)the second index should hold the number of planets
%with a radius greater than earth's radius and less
%than or equal to super earth's radius
%(3)(4)(5)etc.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
