multiplication of multiple type matrices

조회 수: 4 (최근 30일)
Nazrin Afiq Abdul Rahman
Nazrin Afiq Abdul Rahman 2021년 1월 21일
댓글: Nazrin Afiq Abdul Rahman 2021년 1월 22일
Hello,
Can someone help me. I alredy forgot about order of matrices in mathematics. What i want to ask is about multiplication of multiple matrices. For example this is the formula . Can someone help me construct the calculation for this formula and explain to me. The dimension for A is a 2x2.
The answer that i get when i multiply all parameter at the same time (example E=A*B*C*D) it get different when i multiply one-by-one (example AB=A*B then ABC=AB*C then ABCD=A*B*C*D). Can someone help me?

답변 (1개)

James Tursa
James Tursa 2021년 1월 21일
편집: James Tursa 2021년 1월 21일
Matrix multiplication is associative, so the order of the multiplication doesn't matter mathematically. You might get small differences due to numerical effects. If you are getting something vastly different then maybe you can show us the exact code you are using and we can comment on it.
That being said, if A is 2x2 then the inverse of will only exist if A is full rank. And if that is the case then your equation reduces to alpha = [dx dy]*inv(A), in which case maybe you should be doing this instead: alpha = [dx dy]/A
Are you sure about the dimensions of A?
  댓글 수: 1
Nazrin Afiq Abdul Rahman
Nazrin Afiq Abdul Rahman 2021년 1월 22일
hello james,
This is the code that i had made so far:
clear all;
clc;
coord_rso=xlsread('COORDINATE_STN_RSO.xlsx');
coord_cas_jhr=xlsread('COORDINATE_STN_CASSINI_JOHOR.xlsx');
[X,Y]=deal(coord_rso(:,2),coord_rso(:,1));
deltaX=X-X(1);
deltaY=Y-Y(1);
A=[deltaX(2),deltaY(2);deltaX(3),deltaY(3)];
tran_A=transpose(A);
delta_user=[deltaX(2),deltaY(2)];
net_coeff=delta_user*inv(A*tran_A)*tran_A;
this is the excel file that i had imported:
COORDINATE_STN_RSO.xlsx=[172530.8 , 626585.2 ; 165356.8 , 657367.8 ; 2858.3 , 591132.8 ]
the net_coeff is the final answer. But when im trying to multiply the matrices one-by-one it get different from the result of the code. So it makes me curious on the code that i made so far is it true or not.

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2008b

Community Treasure Hunt

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

Start Hunting!

Translated by