Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear;clf cla hold on %subplot(2,1,1) [x1,y1,z1]=meshgrid(-2:.5:2, -2:.5:2, -2:.5:2); [x2,y2,z2]=meshgrid(-2:.5:2, -2:.5:2, -2:.5:2); %z=zeros(21); for i=1:length(x1) for j=1:length(y1) for k=1:length(z1) if z1(i,j,k)==0 P(i,j,k)= x1(i,j,k).*y1(i,j,k); Q(i,j,k)= y1(i,j,k)^2-x1(i,j,k)^2; R(i,j,k)=0; end if z1(i,j,k)~=0 P(i,j,k)= 0; Q(i,j,k)= 0; R(i,j,k)=0; end end end end [u,v,w]=curl(x2,y2,z2,P,Q,R); u=zeros([9 9 9]); v=zeros([9 9 9]); quiver3(x1,y1,z1,P,Q,R) CurlPlot=quiver3(x2,y2,z2,u,v,w, 'Color','r'); set(CurlPlot,'LineWidth', 1, 'MaxHeadSize', .75) grey=[.7 .7 .7]; set(gcf, 'Color', grey) view(75,25) grid on set(gca, 'Color', 'w', 'GridLineStyle', '--')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement