plot Landau cylinder and sphere

3 次查看(过去 30 天)
Yuriy Yerin
Yuriy Yerin 2021-3-4
Hello everybody.
I'd like to plot the so-called Landau cylinder in Matlab with n number of internal cylinders, something like in the figure below.
Also, is it possible to slice the sphere in the same manner to vizualize the presence of sections.
I appreciate for the help.

回答(2 个)

Bjorn Gustavsson
Bjorn Gustavsson 2021-3-4
Just look at the help and documentation of cylinder - that will give you a "unit-cylinder" that you then can scale (both radius and height) to your desires, and then plot each cylinder using surf. For horizontal slices you'll just get a (sub-)set of circles but for a general slice you'll have to work out what parts of which ellipses will contribute.
HTH

Yuriy Yerin
Yuriy Yerin 2021-3-4
The problem was solved by means of the code
function z=cylinder_plot
r=linspace(5,0.1,7);
for i=1:7
[x,y,z] = cylinder(r(i));
z(2, :) = -r(1)*sin(pi/2*(i)/length(r));
surf(x,y,z, 'FaceColor', 'interp','edgecolor','none');
axis equal
hold on
end
hold on
for i=1:7
[x,y,z] = cylinder(r(i));
z(2, :) = r(1)*sin(pi/2*(i)/length(r));
surf(x,y,z, 'FaceColor', 'interp','edgecolor','none');
axis equal
hold on
end
c = parula;
%c = fliplr(c);
colormap(c)
end

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by