What is the algorithm used by gradient in Matlab?
3 次查看(过去 30 天)
显示 更早的评论
I have been using the gradient function in Matlab to run some simulations, and have been using it like a black box, but I would like to know how exactly is the gradient calculated by Matlab. Is it by centered differences? How does it compute the gradient near the edges of the array for which you want to calculate the gradient?
0 个评论
采纳的回答
Walter Roberson
2012-8-27
You can examine the source code:
type gradient
It uses forward differences at the edges, and centered differences in the interior.
1 个评论
Jan
2012-8-27
Looking into the help section (help gradient), the documentation (doc gradient) and in the source code (type gradient) are three strategies to solve such problems locally without the need to ask the forum.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!