How can I calculate the gradient of my data that is in the polar coordinates in MATLAB 7.8 (R2009a)?
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a dataset in the polar coordinates and would like to calculate its gradient but cannot find a function for the same.
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
The ability to directly calculate the gradient of data that is in the polar coordinates in not available in MATLAB 7.8 (R2009a).
The general equation for the polar gradient is:
gradient(F) = del(F)/del(r) + 1/r * del(F)/del(theta)
As a workaround, given:
F = matrix of F values varying along r and theta
r = vector of radius values
theta = vector of radian values
the following code can be used to calculate the gradient.
% Take the gradient of F, suppose that the values of r vary along the rows
% (and are constant along the columns) and that the values of theta vary
% along the columns and are constant along the rows.
[ dFr dFt ] = gradient(F,r,theta);
% Modify the results for dFt, as the second term in the polar gradient
% is divided by the value of r
dFt = dFt./(repmat(r(:)',length(theta),1);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Cartesian Coordinate System Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!