How to enter matrices in MATLAB


( All variables in Matlab represent matrices. Thease matrices can have real or complex entries.
One by one matrices are interpreted as scalars.
 Matrices of the size n-by-1 or 1-by-n are interpreted as column or row vectors.

Four ways that you can enter matrices into Matlab are:

a) Enter an explicit list of elements. Example:  A= [ 1 2 3; 3 4 5]

b) Generate matrices using built-in statements and functions.  Example:  A= eye(A)

c) Create matrices in M-files. 

d) Load matrices from an external data file.