Assignment 4-1
Assignment 4-1
y = x sin(x)
and
z = x cos(x)
(a) Create an x–y plot of x and y.
(b) Create a polar plot of x and y.
(c) Create a three-dimensional line plot of x, y, and z. Don’t forget a title and labels.
(d) Generate a contour plot of Z.
(e) Generate a combination surface and contour plot of Z.
6. Create x and y vectors from −5 to +5 with a spacing of 0.5. Use the meshgrid function to map x and y onto two new
two-dimensional matrices called X and Y . Use your new matrices to calculate vector Z, with magnitude
p
Z = sin( X 2 + Y 2 )