Gradient is zero yet exists
2 ビュー (過去 30 日間)
古いコメントを表示
Hello gradient (140,150), the answer is 0, but it exIhere is my error please? Also, is diff for calculating the derivative? GS.
0 件のコメント
採用された回答
Stephen23
2017 年 9 月 6 日
Why would you expect
>> gradient(140,150)
ans = 0
to be non-zero? You are asking for the gradient at one point... to be honest I am surprised that it does not return NaN. Did you read the gradient documentation to know what the two arguments are for?
Perhaps you really wanted to do this:
>> gradient([140,150])
ans =
10 10
"Also, is diff for calculating the derivative?"
Did you read the diff documentation? It answers your question, right on the very first line.
6 件のコメント
Stephen23
2017 年 9 月 13 日
@John D'Errico: while we should clearly acquiesce to Messrs Simon and Garfunkel's authority on the subject of hammers vs. nails, how do spades fit into this? It leaves us with some small conundrums to resolve: is the relationship between spades, hammers, and nails associative and/or commutative? Can this be generalized to all tools? Who can write the simplest vectorized code for this?
John D'Errico
2017 年 9 月 13 日
編集済み: John D'Errico
2017 年 9 月 13 日
I think I need next to visit Scarborough Fair. They have a large library there, wherein I can do the necessary research. For example, are spades lesser or greater than nails? I think what matters is if some sort of transitivity relation exists in this matter.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Aerospace Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!