Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between matrix and array?

Tags:

math

matlab

What is the more generalized term? Why is MATLAB named matrix laboratory, then?

like image 382
ezzeddin Avatar asked Mar 12 '15 21:03

ezzeddin


People also ask

What is the difference between array and matrix in python?

The arrays in Python are ndarray objects. The matrix objects are strictly 2-dimensional whereas the ndarray objects can be multi-dimensional.

What's the difference between array and matrix in MATLAB?

Matrix operations follow the rules of linear algebra. By contrast, array operations execute element by element operations and support multidimensional arrays. The period character ( . ) distinguishes the array operations from the matrix operations.

Is matrix also an array?

A matrix is a 2D array with which follows the rules for linear algebra. It is, therefore, a subset of more general arrays which may be of higher dimension or not necessarily follow matrix algebra rules.

What is the difference between an array a matrix and a vector?

A matrix is a two-dimensional vector (fixed size, all cell types the same). An array is a vector with one or more dimensions. So, an array with one dimension is (almost) the same as a vector. An array with two dimensions is (almost) the same as a matrix.


1 Answers

A matrix is a practical way to represent a linear transformation from a space of dimension n to a space of dimension m in the form of a nxm array of scalar values.

It is also very practical to perform linear algebra operation in a very systematic way that can be implemented on a computer. For instance if matrix A represents the linear transformation f and matrix B the linear transformation g, then the composition f o g writes as A*B where * denotes matrix multiplication. Matlab has also a lot of routines related to matrix operations (i.e. linear algebra operations) like det, pinv, svd etc...

As you can still see nowadays in Matlab, operators like *, / are strongly tied to matrix operations and thus strongly tied to linear algebra operations, which I think was the original goal of matlab in its early elaboration, hence its name (surely quite speculative but guess not so far from reality).

To perform element-wise operations on n-dimensional data sets, you have to write .*, or ./. denoting you are now performing array operations.

I would not say array operations encompass matrix operations, they are different. The later ones relate to linear algebra, while the other ones just relate to a practical way to operate on large sets of data. These data are not limited to be numbers, they are just n-dimensional data sets of whatever (string, numbers, cells, etc...).

Matlab also has a very synthetic syntax to perform array operations on sub-blocks (i.e. linear/logical subscripts) that makes it very easy to reorganize data sets in just one line of code before applying subsequent matrix or array operations.

like image 135
CitizenInsane Avatar answered Oct 10 '22 07:10

CitizenInsane