Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. MATLAB contains a function, sphere, that calculates the 3-D coordinates of a sphere with a specified resolution. The syntax is [x, y, z] =

2. MATLAB contains a function, sphere, that calculates the 3-D coordinates of a sphere with a specified resolution. The syntax is [x, y, z] = sphere(n)

where n is the resolution. The resulting x, y, z coordinates can be used to create a surface plot of the sphere using the surf function.

a. Create a variable n to contain the resolution. Initially set it equal to 10.

b. Generate the coordinates of a sphere using the sphere function.

c. Create a surface plot of the sphere.

d. Set the shading to interp for a smooth plot.

e. The surf function defaults to coloring the plot based on the values of z. By changing the plot to grayscale it gives a shading effect. Change the color map to gray with the function call colormap(gray).

f. The default behavior is to use different lengths for the axes. To make them all the same (so the shape of the sphere isnt distorted), use the daspect function as follows: daspect([1, 1, 1]).

g. Label the x, y, and z axes x, y, and z

h. This plot looks pretty chunky. Create another plot using a resolution of 100 instead of 10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

Describe the difference between compensatory and punitive damages.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago