How can I graph a cylindrical magnetic dipole?
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
How can I graph a cylindrical magnetic dipole?
0 Commenti
Risposte (1)
  chicken vector
      
 il 26 Apr 2023
        3 Commenti
  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')
Vedere anche
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!

