vector operations exercise 2

##### Title

##### Question

Sir, unable to get output for the following

A*C-C*A

2*C-6*A

(2*C-6*A')*B'

getting error..

instead of getting error is there any alternate method to get some solution for matrix operation..

Scilab Vector-Operations 04-05 min 40-50 sec

__Answers:__

The error is a part of the exercise. It is meant to motivate understanding of matrices with inconsistent sizes. Type size(A) and then size(C), and compare the dimensions.

May be Vectors have not proper number of raw and columns to multiply.

to substract two matrices number of rows and cols of both matrix must be same.

rows and cols of A*C and C*A are different.

so its giving substraction error

The same reason for multiplication operation also. Please check the condition for matrix multiplication operation.

In statement 1 A*C returns 3*3 matrix and C*A returns 2*2 matrix so subtraction is not possible.

In statement 2 2*C returns 2*3 matrix and 6*A returns 3*2 matrix again so subtraction possible in that case.

In statement 3 2*C-6*A' returns 2*3 matrix and B' returns 2*1 matrix so multiplication is not feasible as no. of columns of first are not equal to no. of rows of second.

I think this will help.

04-05-19, 12:15 p.m.chitraraj05Login to add comment