%
%   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 gradient in cylindrical coordinates


function[Ar,Aphi,Az] = gradCyl(f)
syms r phi z
Ar = diff(f,r);
Aphi = 1/r*diff(f,phi);
Az = diff(f,z);