This is a draft cheat sheet. It is a work in progress and is not finished yet.
Matlab Commands and Outputs
A command that has two numbers separated by a colon will result in all the numbers between in increments of 1. |
A command that has 3 numbers separated by colons will go from the 1st to last number in increments of the 2nd number |
If there is a semicolon on any of the commands, nothing will result |
t=2:7 will result in t= 2 3 4 5 6 7 |
t=9:-1:3 will result in t= 9 8 7 6 5 4 3 |
t=5; shows nothing |
Matrices
In order to find something in a matrix use the following code: |
When a colon is used in place of a specific subscript, the colon represents the entire row or column |
In order to transpose a matrix, write out the what was row and put a semicolon at the end to make a column |
a=matrixname(row, column) |
b=matrixname(:,1) would result in the entire first column |
v=[ 2 4 6 3; 6 9 4 3] would have a matrix like: |
|
|
|
|
|