Matrices

45 views
Skip to first unread message

MarkJ

unread,
Jan 21, 2024, 6:55:40 PMJan 21
to Free42 & Plus42
If all goes well for me a pdf document will show up for people to look at. At the top of a document is a formula using matrices. My question is whether Free42 can multiply a column vector and a matrix in the fashion shown in the document. I get a 'Dimension Error' message when i try the DOT  menu operation.

The document is a page from "Practical Astronomy With Your Calculator", by Peter Duffett-Smith.
matices-duffett-smith.pdf

RA Prism

unread,
Jan 21, 2024, 7:26:05 PMJan 21
to Free42 & Plus42
Matrix multiplication like in A*x=b works with x (Multiplication). Dot is the scalar product, which requires 2 vectors (Nx1 dim).

Thomas Okken

unread,
Jan 21, 2024, 8:28:07 PMJan 21
to Free42 & Plus42
That is correct. And more generally, × performs matrix-matrix multiplication like this: with an M×N matrix in Y and an N×P matrix in X, x returns an M×P matrix, where each element i,j is the dot product of row i of the M×N matrix and column j of the N×P matrix. And this includes operations with vectors, where an M-element column vector is an M×1 matrix, and an N-element row vector is a 1×N matrix.

DOT computes the dot product of two vectors, but it is very lenient about the shape of its parameters. It will accept any combination of matrices in X and Y, as long as they have the same number of elements. That is, it will consider an M×N matrix to be an MN-dimensional vector. Thus, when multiplying two actual vectors, i.e. M×1 or 1×M matrices, it will do what you expect, and it won't care if they are row or column vectors, and it will even multiply a 2×6 and a 3×4 matrix, acting as if they were both 12-dimensional vectors, reading both their elements from left to right and top to bottom.
Reply all
Reply to author
Forward
0 new messages