Revolving a curve around the z- axis

6 views (last 30 days)
John Omoruyi
John Omoruyi on 13 Jun 2022
Answered: Star Strider on 13 Jun 2022
Hello there,
I'm new here, so I'll just get to it:
The intention is to generate path lines, which i can actually consider done with the underneath
[x,y]=meshgrid(-10:0.01:10,-10:0.01:10);r=sqrt(x.^2+y.^2);
z=log(r);
figure(1);
contour3(x,y,z,30)
Now in continuation of this, how do I plot stream lines with the description r=exp(z) or z=log(r) 12 times equally placed around the z-axis?
Answers would be very much appreciated, thank u.

Answers (1)

Star Strider
Star Strider on 13 Jun 2022
The easiest way to do that would likely be to use the cylinder function —
x = -10:0.01:10;
y = -10:0.01:10;
r=sqrt(x.^2+y.^2);
z=log(r);
[X,Y,Z] = cylinder(z);
figure
contour3(X, Y, Z, 30)
grid on
colormap(turbo)
x = linspace(-10, 10, 30);
y = linspace(-10, 10, 30);
r=sqrt(x.^2+y.^2);
z=log(r);
[X,Y,Z] = cylinder(z);
figure
hm = mesh(X, Y, Z);
hm.MeshStyle = 'column';
grid on
colormap(turbo)
The contour3 plot however does not match my impression of what ‘streamlines’ would look like. The mesh plot could be another option.
.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!