plot Landau cylinder and sphere

2 vues (au cours des 30 derniers jours)
Yuriy Yerin
Yuriy Yerin le 4 Mar 2021
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.

Réponses (2)

Bjorn Gustavsson
Bjorn Gustavsson le 4 Mar 2021
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 le 4 Mar 2021
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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by