필터 지우기
필터 지우기

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 CenterFile Exchange에서 Elementary Math에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by