%
%   Book: MATLAB-Based Electromagnetics (Pearson Prentice Hall)
%   Author: Branislav M. Notaros
%   Instructor Resources
%   (c) 2011
%
%   This MATLAB code or any part of it may be used only for 
%   educational purposes associated with the book
%
%
%


%     Symbolic expression for the electric dipole field


clear all;
close all;
syms EPS0 p r phi theta

V = p*cos(theta)/(4*pi*EPS0*r^2);

[Er,Et,Ep] = gradSph(-V);
E = [Er,Et,Ep];
pretty(E);

