필터 지우기
필터 지우기

how can i do Matrix multiplication with 3 matrices

조회 수: 2 (최근 30일)
Azime Beyza Ari
Azime Beyza Ari 2022년 4월 10일
댓글: Azime Beyza Ari 2022년 4월 11일
Hello everyone,
I have 3 matrixs with dimensions;
x[36,36] , rij[36,36], and ai[36,1]
i wanna multpily these matrixes and sum each of them. what i want should look like this;
x(1,1)*r(1,1*ai(1)+x(1,2)*r(1,2)*ai(1)+.....+
x(2,1)*r(2,1)*a(2)+x(2,2)*r(2,2)*a(2)+....+
x(36,1)*r(36,1)*a(36)+x(36,36)*r(36,36)*a(36)
i have tried this;
z= sum((x.*rij)*a,'all');
but this is doing this ;
x(1,1)*r(1,1*ai(1)+x(1,2)*r(1,2)*ai(2)+.....+x(2,1)*r(2,1)*a(1)+x(2,2)*r(2,2)*a(2)+....+ x(36,1)*r(36,1)*a(1)+x(36,36)*r(36,36)*a(36)
But this is not i want!
Hope what i want to do is clear!
Thank you in advance!
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 4월 10일
Are you sure that the second indices for r should be calculated in terms of ai(1) ?
x(1,1)*r(1,1*ai(1)+x(1,2)*r(1,2)*ai(1)+.....+
^^^^
Notice that you did not close the ) after r(1,1
x(2,1)*r(2,1)*a(2)+x(2,2)*r(2,2)*a(2)+....+
Notice that you do close the ) after r(2,1) .
Azime Beyza Ari
Azime Beyza Ari 2022년 4월 10일
편집: Azime Beyza Ari 2022년 4월 10일
Sorry for that, it is a typo. It should be closed.

댓글을 달려면 로그인하십시오.

채택된 답변

Bruno Luong
Bruno Luong 2022년 4월 10일
sum(x.*rij,2)' * ai

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by