Partial derivative of a matrix

15 ビュー (過去 30 日間)
John
John 2015 年 1 月 14 日
編集済み: Mohammad Abouali 2015 年 1 月 14 日
I have a matrix V, say 3-by-3. How can I compute dV/dx and dV/dy separately? dV/dx is partial derivative wrt x (along the columns), same for y. I use gradient function, but it returns a matrix of same size as V. Any help or idea? Thanks.

採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 1 月 14 日
編集済み: Mohammad Abouali 2015 年 1 月 14 日
For simple cases use MATLAB's gradient() function. Assuming you have a regularly spaced grids:
[Vx,Vy,Vz] = gradient(V,h);
[Vx,Vy,Vz] = gradient(V,h1,h2,h3);
If your domain is more complicated or you are looking for higher order operator lookup Finite Difference schemes or Finite Volume ones.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by