필터 지우기
필터 지우기

What is the algorithm used by gradient in Matlab?

조회 수: 1 (최근 30일)
Francisco
Francisco 2012년 8월 27일
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?

채택된 답변

Walter Roberson
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
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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by