Question: Create your own planet! Write a script entitled lab0304.m that creates a rough sketch of your planet in 3-d. Create a 50 x 50 matrix

 Create your own planet! Write a script entitled lab0304.m that creates

Create your own planet! Write a script entitled lab0304.m that creates a rough sketch of your planet in 3-d. Create a 50 x 50 matrix of default values (maybe A = zeros(50)) then change the values where you want a land mass (A(10:20, 20 : 30) = 1). You must create 5 independent land masses. You will need to obtain your x,y,z coordinates from the sphere function, then use the surface function to overlay your 50 x 50 matrix of values. Note: the indexing on the sphere will start at the south pole...of course if you end up with your earth upside-down just rotate it using the tool in the figure window. The colormap function will allow you set the colors of our planet however you choose. The input will be RGB values in rows scaled as a percentage (both methods below are valid): colormap([1 0 0; 0 1 0; 0 0 1]) colormap([255/255 0 0; 0 255/255 0; 0 0 255/255]) The code above will set your RGB values as red (1,0,0), green (0,1,0), blue (0,0,1). If you are wanting a challenge and extra credit), feel free to model our earth. In order to replicate the earth you will likely need the grid on the next page to "draw" the continents. Note: The grid is 25 blocks high by 50 blocks wide so you will need to add 12 rows above and 13 below to obtain your 50 x 50 matrix. The sphere(50) function will produce your planet with an n x n grid overlay. You will need colormap( [0 1 0;0 0 1]) to get your green (0,1,0) and blue (0,0,1) colors to appear on the globe. Interact with your planet by using the 'rotate 3d' tool in the figure window (it is a circular arrow). Comment, comment, comment! Create your own planet! Write a script entitled lab0304.m that creates a rough sketch of your planet in 3-d. Create a 50 x 50 matrix of default values (maybe A = zeros(50)) then change the values where you want a land mass (A(10:20, 20 : 30) = 1). You must create 5 independent land masses. You will need to obtain your x,y,z coordinates from the sphere function, then use the surface function to overlay your 50 x 50 matrix of values. Note: the indexing on the sphere will start at the south pole...of course if you end up with your earth upside-down just rotate it using the tool in the figure window. The colormap function will allow you set the colors of our planet however you choose. The input will be RGB values in rows scaled as a percentage (both methods below are valid): colormap([1 0 0; 0 1 0; 0 0 1]) colormap([255/255 0 0; 0 255/255 0; 0 0 255/255]) The code above will set your RGB values as red (1,0,0), green (0,1,0), blue (0,0,1). If you are wanting a challenge and extra credit), feel free to model our earth. In order to replicate the earth you will likely need the grid on the next page to "draw" the continents. Note: The grid is 25 blocks high by 50 blocks wide so you will need to add 12 rows above and 13 below to obtain your 50 x 50 matrix. The sphere(50) function will produce your planet with an n x n grid overlay. You will need colormap( [0 1 0;0 0 1]) to get your green (0,1,0) and blue (0,0,1) colors to appear on the globe. Interact with your planet by using the 'rotate 3d' tool in the figure window (it is a circular arrow). Comment, comment, comment

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!