How can I graph a cylindrical magnetic dipole?

2 次查看(过去 30 天)
How can I graph a cylindrical magnetic dipole?

回答(1 个)

chicken vector
chicken vector 2023-4-26
With quiver or quiver3 [Ref].
  3 个评论
chicken vector
chicken vector 2023-4-27
The magnetic field looks okay, you need to plot the cylinder?
chicken vector
chicken vector 2023-4-27
编辑:chicken vector 2023-4-27
r = 3;
n = 50;
scale = 5;
[X,Y,Z] = cylinder(r,n);
Z = Z*scale;
figure;
hold on;
surf(X,Y,Z,'FaceColor','r','EdgeColor','None');
fill3(X(2,:),Y(2,:),Z(2,:),'r');
surf(X,Y,Z-scale,'FaceColor','b','EdgeColor','None');
fill3(X(2,:),Y(2,:),Z(1,:) - scale,'b');
text(1.2*r*cos(pi/4),1.2*r*sin(pi/4),scale/2,'N','FontSize',32)
text(1.2*r*cos(pi/4),1.2*r*sin(pi/4),-scale/2,'S','FontSize',32)
hold off;
axis equal;
view([1 1 1])
set(gca,'XColor','None','YColor','None','ZColor','None','Color','None')

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by