Just making sure my 3dplot is as the question is asking

Problem: Use the plot3 command to create a 3D plot for the following function: d = 0 to 10*pi (with increment of 1) Plot sin(d) and cos(d) as the independent variables and z as the dependent variable. z=sin(d)*cos(d) Label each axis and give a title to the whole graph.
My code: format short
d = [0:1:(10*pi)];
z = sin(d).*cos(d);
a = sin(d);
b = cos(d);
plot3(a,b,z)
title('3d Plot of d(0to10pi inc of 1) vs sin(d) and cos(d)')
xlabel('sin(d)')
ylabel('cos(d)')
zlabel('sin(d)*cos(d)')
Just making sure this is along the lines of the requested code to be made

 Réponse acceptée

Star Strider
Star Strider le 3 Fév 2018

0 votes

It seems correct to me, and produced the plot I would expect. I would add grid on at the end to include the grid (personal preference).

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by