Gradient function of matlab
이전 댓글 표시
Can someone please explain how gradient function works? (say, how is dx1(1,2)==0.5)
>> a=[1 3 2 11 18; 7 14 9 5 10; 15 7 13 18 9; 19 12 17 7 14 ]
a =
1 3 2 11 18
7 14 9 5 10
15 7 13 18 9
19 12 17 7 14
>> [dx1 dy1]=gradient(a)
dx1 =
2.0000 0.5000 4.0000 8.0000 7.0000
7.0000 1.0000 -4.5000 0.5000 5.0000
-8.0000 -1.0000 5.5000 -2.0000 -9.0000
-7.0000 -1.0000 -2.5000 -1.5000 7.0000
dy1 =
6.0000 11.0000 7.0000 -6.0000 -8.0000
7.0000 2.0000 5.5000 3.5000 -4.5000
6.0000 -1.0000 4.0000 1.0000 2.0000
4.0000 5.0000 4.0000 -11.0000 5.0000
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!