How do I create a tornado figure using plot3 and comet3 commands?

In summary, the conversation is about a student struggling with a problem in their Intro to Computing for Engr. course that involves using MATLAB and manipulating input values to create a graph that looks like a tornado. The student is seeking help with the math involved in the problem, not with using MATLAB. They provide the original problem and their attempt at a solution. The conversation also mentions the use of the plot3 and comet3 commands for plotting in three dimensions. The conversation ends with the student stating that they have figured out the solution.
  • #1
GreenPrint
1,196
0

Homework Statement



Hi,

I'm taking Intro to Computing for Engr. and my highest level math course I have taken is Calculus I. I'm trying to solve this problem in my book for Intro to Computing for Engr. and believe that the math is over my head. This may well be the case. But sense this is a course in which I'm trying to learn how to use MATLAB and not whatever math course in which I would learn how to do such a thing as in the title so I'm kind of lost as to what to do. It's not that I need help using MATLAB I just need help with the math.

5.28

See the first attachment, it's Figure P5.28 in the book

"Figure out how to adjust your input to plot3 in Problem 5.27 so as to create a graph that looks like a tornado. (See Figure P5.28.) Use comet3 instead of plot3 to create the graph."

Note that the plot3 command just plots in three dimensions and comet3 is a command that just plots in three dimensions but allows the use to view the graph being plotted. The inputs to both commands are just the x values, the y values, and the z values.

Alright problem 5.27 had me plotting a three dimensional graph were
x=[0:pi/100:20*pi]
Note that this is just all the values that occur from 0 to 20*pi by increments of pi/100
y = x sin(x)
z = x cos(x)

The resulting graph that I got when I graphed it using the plot3 command is the second attachment.

Alright I have no idea how to manipulate plot3(x,y,z), (see were I defined x, y, and z), to get the tornado figure and was hoping someone could point me in the right direction in some way shape or form.

Thanks!

Homework Equations





The Attempt at a Solution

 

Attachments

  • snip.JPG
    snip.JPG
    20.7 KB · Views: 1,000
  • snip2.JPG
    snip2.JPG
    40.9 KB · Views: 722
Physics news on Phys.org
  • #2
The problem does not say "manipulate plot3(x, y, z)". It says alter your input. What is your input for 5.27?
 
  • #3
it's just
plot3(x,y,z)
were
x=[0:pi/100:20*pi]
y = x sin(x)
z = x cos(x)
 
  • #4
Here's the original problems. The problems are exactly the same but the numbering is different because it's from the first version of the book but were using the second version in our course. I got the first version on my computer. The wording is exactly the same as that of my book the numbering is just different.

Here's what I did for 5.27, and the resulting graph for part (c) is the second attachment for the first post, and is what is being referred to in the next problem which I'm completely lost as to were even to begin

%5.27
x=[0:pi/100;20*pi];
y=[x.*sin(x)];
z=[x.*cos(x)];
%(a)
plot(x,y)
title('xsin(x)');
xlabel('x');
ylabel('xsin(x)');
grid on
%(b)
polar(x,y)
title('xsin(x)');
grid on
%(C)
x=[0:pi/100;20*pi];
y=[x.*sin(x)];
z=[x.*cos(x)];
plot3(x,y,z)
title('xsin(x) & xcos(x)');
xlabel('x');
ylabel('xsin(x)');
zlabel('xcos(x)');
grid on
 

Attachments

  • 5.28.JPG
    5.28.JPG
    12.1 KB · Views: 649
  • 5.28222.JPG
    5.28222.JPG
    32.7 KB · Views: 986
  • #5
i got it
 

What is a 3D Tornado Figure?

A 3D Tornado Figure is a type of plot used to visualize data in three dimensions. It is typically used to show the relationship between three variables or factors.

What type of data is best suited for a 3D Tornado Figure?

A 3D Tornado Figure is best suited for data that has three variables or factors, such as time, location, and magnitude. It is especially useful for showing the relationship between these variables and how they change over time or space.

How do you create a 3D Tornado Figure?

To create a 3D Tornado Figure, you will need to use a software program or coding language that supports 3D plotting. Some popular options include MATLAB, Python, and R. You will also need to have your data organized in a way that can be plotted in three dimensions, typically in a tabular or matrix format.

What are the benefits of using a 3D Tornado Figure?

A 3D Tornado Figure allows for a more comprehensive understanding of the relationship between three variables or factors. It also allows for the visualization of complex data and patterns that may not be easily seen in a traditional 2D plot.

What are the limitations of a 3D Tornado Figure?

While a 3D Tornado Figure can be useful for certain types of data, it can also be misleading if not used correctly. It can also be difficult to interpret and may not be suitable for all types of data. Additionally, it can be time-consuming and resource-intensive to create and may not provide much additional information compared to a simpler 2D plot.

Similar threads

  • Calculus and Beyond Homework Help
Replies
10
Views
986
  • Programming and Computer Science
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
467
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
141
  • Calculus and Beyond Homework Help
Replies
7
Views
699
  • Programming and Computer Science
Replies
1
Views
256
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top