plot Landau cylinder and sphere

조회 수: 4 (최근 30일)
Yuriy Yerin
Yuriy Yerin 2021년 3월 4일
답변: 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에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by