/rm);
%所求点电势
[Ex,Ey]=gradient(-V);
%根据该点电势对x、y求偏导的负值就是该点x、y方向场强
AE=sqrt(Ex.2+Ey.2);Ex=Ex..../AE;Ey=Ey..../AE;
cv=linspace(min(min(V)),max(max(V)),201);
contour(X,Y,V,cv,‘r-’)
%画图
title('电偶极子全平面场强分布图 '),...hold on
quiver(X,Y,Ex,Ey,0.6,‘g’)
plot(a,b,‘bo’,a,b,‘gd’)
plot(-a,-b,‘bo’,-a,-b,‘w*’)
xlabel(‘X axis