フィルターのクリア

What do I have to do if I want to derivative and continue multiplying?

1 回表示 (過去 30 日間)
chayanon summueang
chayanon summueang 2022 年 5 月 17 日
回答済み: KSSV 2022 年 5 月 17 日
If I have two matrices
A = [1 2;3 4;5 6];
B = [7 8;9 10;11 12];
but my final equation is
D = transpose(A)*diff(B);
resulting in diff(B) has a dimension 2x2 but transpose(A) has a dimension 2x3
What's the best way to multiply them? (do not use .*)
Or should I use a gradient to maintain the dimensions of diff(A)?
Thank you for your helpful answers!!

回答 (1 件)

KSSV
KSSV 2022 年 5 月 17 日
A = [1 2;3 4;5 6];
B = [7 8;9 10;11 12];
D = A'*gradient(B)
D = 2×2
9 9 12 12

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by