Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Draw graph on MATLAB https://www.dropbox.com/s/dj51yt0t3f194k2/planets.mat?dl=0 UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 8 load('planets.mat'); 0 %%The data are stored in the planets.mat file. 1 %%run this code and check out the
Draw graph on MATLAB
https://www.dropbox.com/s/dj51yt0t3f194k2/planets.mat?dl=0
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 8 load('planets.mat'); 0 %%The data are stored in the planets.mat file. 1 %%run this code and check out the Workspace to see what gets loaded in. 2 %%Here is the information you need: 3 %names_pl - a cell array storing the names of each planet 4 %rad - an array of doubles storing the radius of each planet in miles 5 %orb - an array of each planet's orbit in days 6 %temp - an array of each planet's equilibrium temperature in Kelvin 7 %dist - an array of the distance from each planet to its sun in 8 %units of Solar Radius 0 rad_mars = 2106; miles 1 rad_earth = 3959; miles rad_superearth=2*rad_earth; rad_saturn = 36184; miles miles 7 %%Part 1 - Bin planets by size 8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 bin=zeros(1, 5); %initialiing the arrays of bins 0 %(1) the first index should hold number of planets with 1 %a radius less than or equal to mars' radius 2 %(2) the second index should hold the number of planets 3 %with a radius greater than mars' radius and less 4 %than or equal to earth's radius 5 %(3) (4) (5) etc. 6 %TO DO: Fill this in Part 1 - Binning by Size Finish this part and you will get at least a C grade on functionality. You are going to categorize the exoplanets into five bins: 'smaller than Mars', 'smaller than Earth', 'Super Earth Size (1-2 times Earth Size)', 'smaller than Saturn', 'greater than Saturn'. Each planet should be binned only once (so you will need to determine the other side of the range, e.g. for smaller than Saturn, you should include only planets that are larger than superearth). Make a bar graph of the five bins and label properly. You may not use an if statments or loops, use only array operations. After determining how many planets satisfy each of the five conditions, you will store those quanties in each of the five elements of the arrays with variable name 'bin'. Your bar graph should look like this (this was done with 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 mars', 'larger than mars and smaller than or equal to earth', etc.): Exoplanets Binned by Size 1200 -Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started