Linear Equations -- JHU MATLAB Help Page
LINEAR EQUATIONS
Creating a Matrix
Substituting Within a Symbolic Matrix
Manipulating Regular Matrices
Vectors
Scalar Multiplication
Addition of Matrices
Gauss-Jordan Elimination
Reduced Row-Echelon Form
Dot Product
Rank
Number of Solutions
Creating a Matrix
How to
Examples
Exercise
How to:
Creating a matrix , say Matrix A, within MATLAB is really quite simple, just type:
A = [First row entries; Second row entries; etc.]
Or for a symbolic matrix (one that has any number of variable names as entries), type:
A = sym('[First, row, entries; Second, row, entires; etc.]')
Examples:
So, if you wanted to create a matrix that was 3x3 with all of its entries being the number 13:
R = [13 13 13; 13 13 13; 13 13 13]
Or if you wanted to create a symbolic 2x4 matrix that went through the letters starting with 'a' you would type:
S = sym('[a, b, c, d; e, f, g, h]')
(note: in symbolic matrices commas are used to separate entries, unlike regular matrices)
Exercise:
Create a 4x4 matrix that counts from 1 through 16, row by row.
Click here to see the answer.