How can I graph a cylindrical magnetic dipole?

2 visualizzazioni (ultimi 30 giorni)
How can I graph a cylindrical magnetic dipole?

Risposte (1)

chicken vector
chicken vector il 26 Apr 2023
With quiver or quiver3 [Ref].
  3 Commenti
chicken vector
chicken vector il 27 Apr 2023
The magnetic field looks okay, you need to plot the cylinder?
chicken vector
chicken vector il 27 Apr 2023
Modificato: chicken vector il 27 Apr 2023
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')

Accedi per commentare.

Categorie

Scopri di più su Vector Fields in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by