Matrix operations

조회 수: 4 (최근 30일)
Samantha Steele
Samantha Steele 2011년 9월 20일
So i am having trouble with one of my homework problems..
i am given matrices
A=[1,21,3;5,7,9;11,12,32];
B=[2,3,4;5,8,11;8,9,22];
C=[2,3,4;7,9,11];
and need to perform the following operations:
inv(A)
A*inv(A)
A*A'
A.*B
A.*C %need help here%
%multiplication%
A=[1,21,3;5,7,9;11,12,32];
B=[2,3,4;5,8,11;8,9,22];
C=[2,3,4;7,9,11];
A*B;
B*A;
A*C;%and here%
C*A%and here%
but for the marked locations matlab gives me an error message.. what can i do differently?
  댓글 수: 1
the cyclist
the cyclist 2011년 9월 21일
It would be really helpful if you could use the "code" button to format your question. It's really difficult to read.

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

채택된 답변

bym
bym 2011년 9월 21일
A is size 3x3, C is size 2x3, therefore:
A.*C
A*C
C*A
are all errors because of dimensions. Without further information you can't do anything differently. Perhaps that was the goal of the assignment?
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 9월 21일
why would (a 2x3) * (a 3x3) be an error? The inner dimensions agree.
Walter Roberson
Walter Roberson 2011년 9월 21일
>> A=[1,21,3;5,7,9;11,12,32];
>> C=[2,3,4;7,9,11];
>> C*A
ans =
61 111 161
173 342 454
Doesn't look like an error to me...

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 9월 21일
I would expect errors for A.*C and A*C, but I would not expect an error for C*A: I would expect a 2 x 3 matrix as the result.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by