gradient_sym(V,X,co​ordinate_system)

This Function calculate the gradient of 3D scalar function
264 Downloads
Updated 14 Mar 2018

View License

This Function calculates the gradient of 3D scalar function in Cartesian, Cylindrical, and Spherical coordinate system.
function gradientSym = gradient _sym(V,X,coordinate_system)
V is the 3D scalar function
X is the parameter which the gradient will calculate with respect to.
coordinate_system is the kind of coordinate system at which the vector field is specified.
the gradient is calculated according to (Engineering Electromagnetics Sixth Edition William H. Hayt, Jr. . John A. Buck)
Example (1):
V=24*cos(pi*y/3)*sin(2*pi*z/3)
gradient_sym(V,[x,y,z],'Cartesian')
Example (2):
V=Vo*exp(-2*r)*sin(3*phi)
gradient_sym(V,[r,phi,z],'Cylindrical')
Example (3):
V=Vo*a/R*cos(2*th)
gradient_sym(V,[R,th,phi],'Spherical')

Cite As

mohamed fekry (2024). gradient_sym(V,X,coordinate_system) (https://www.mathworks.com/matlabcentral/fileexchange/66482-gradient_sym-v-x-coordinate_system), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Linear Algebra in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0