Gradient of a 3d scalar field
10 views (last 30 days)
Show older comments
Hi, sorry if this is a stupid question. However, I am a little confused with the math here which is why I am asking while I browse through literature for answers.
I have a set of scalar values (frequencies) which are evenly positioned in 3d space (corresponding to individual points across a material). Now, I want to determine the gradient of the frequency scalar along the x,y,z dimensions which mathematically can be obtained using partial derivatives in each individual direction.
My arrays are of the following dimensions,
Frequencies: 1x512 double
Positions: 3x512 double
Which gives one frequency value for each position in 3D.
The closest function to this which I found on Matlab was the gradient function (Numerical gradient - MATLAB gradient (mathworks.com)), which when reading through the documentation confused me. A specification of the type gradient(F,hx,hy,...,hN) seems to be possible only if the scalar field is known as a function of the positions rather than as discrete values.
Is my understanding regarding this correct, or am I missing something?
Should I consider manually evaluating the gradient at each point using basic operators?
Thanks for any support to clarify this.
0 Comments
Answers (0)
See Also
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!