Differentiation of matrices using diff

8 ビュー (過去 30 日間)
Vithusha T
Vithusha T 2021 年 3 月 21 日
回答済み: Star Strider 2021 年 3 月 21 日
I need to differentiate alpha w.r.t time (da/dt) where alpha is a 19*1 matrix and time is 19*6 matrix and i tried using diff(a,t) but getting an error that difference order must be a positive scalar integer. When using diff(a)/diff(t), i'm getting a 18*6 matrix but i need a 19*6 matrix as answer.

採用された回答

Star Strider
Star Strider 2021 年 3 月 21 日
Experiment with the gradient function. It may do what you want, although to take the gradient (in this context, numeric spatial derivative) of a matrix, it will be necessary to request the correct result from the two outputs it will provide.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by