Question: Why extracting a n*1 matrix from n*m matrix gives vector?

I am trying to do the following computation. I  extracted n*1 matrix from n*n matrix which unbelievably gives vector?

How I can do the following multiplication without using convert command? Or how to extract n*1 matrix (not vector) from n*n matrix without using convert?

``

restart

``

``

A := Matrix(4, 4, {(1, 1) = m[1, 1], (1, 2) = m[1, 2], (1, 3) = m[1, 3], (1, 4) = m[1, 4], (2, 1) = m[2, 1], (2, 2) = m[2, 2], (2, 3) = m[2, 3], (2, 4) = m[2, 4], (3, 1) = m[3, 1], (3, 2) = m[3, 2], (3, 3) = m[3, 3], (3, 4) = m[3, 4], (4, 1) = m[4, 1], (4, 2) = m[4, 2], (4, 3) = m[4, 3], (4, 4) = m[4, 4]})

A := Matrix(4, 4, {(1, 1) = 0, (1, 2) = m[1, 2], (1, 3) = m[1, 3], (1, 4) = m[1, 4], (2, 1) = 0, (2, 2) = m[2, 2], (2, 3) = m[2, 3], (2, 4) = m[2, 4], (3, 1) = 0, (3, 2) = m[3, 2], (3, 3) = m[3, 3], (3, 4) = m[3, 4], (4, 1) = 0, (4, 2) = m[4, 2], (4, 3) = m[4, 3], (4, 4) = m[4, 4]})

(1)

A(1 .. 4, 1) := Matrix(4, 1):

A

Matrix([[0, m[1, 2], m[1, 3], m[1, 4]], [0, m[2, 2], m[2, 3], m[2, 4]], [0, m[3, 2], m[3, 3], m[3, 4]], [0, m[4, 2], m[4, 3], m[4, 4]]])

(2)

B := A(1 .. 4, 2)

B := Vector(4, {(1) = m[1, 2], (2) = m[2, 2], (3) = m[3, 2], (4) = m[4, 2]})

(3)

A.B

4

(4)

F := Matrix(4, 1, {(1, 1) = 0.4279668887e-7, (2, 1) = -0.3901148183e-7, (3, 1) = 0.3900685346e-7, (4, 1) = 0.})

Typesetting:-delayDotProduct(A, B)-F

Error, (in rtable/Sum) invalid input: dimensions do not match: Vector[column](1 .. 4) cannot be added to Matrix(1 .. 4, 1 .. 1)

 

A.convert(B, Matrix)-F

Matrix(4, 1, {(1, 1) = m[1, 2]*m[2, 2]+m[1, 3]*m[3, 2]+m[1, 4]*m[4, 2]-0.4279668887e-7, (2, 1) = m[2, 2]^2+m[2, 3]*m[3, 2]+m[2, 4]*m[4, 2]+0.3901148183e-7, (3, 1) = m[3, 2]*m[2, 2]+m[3, 3]*m[3, 2]+m[3, 4]*m[4, 2]-0.3900685346e-7, (4, 1) = m[2, 2]*m[4, 2]+m[3, 2]*m[4, 3]+m[4, 2]*m[4, 4]})

(5)

``

Download soalzarb.mw

Please Wait...