plot Landau cylinder and sphere

3 ビュー (過去 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 Center および File Exchange2-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