Documentation
File operation
load <fileName>
will load the data file.
save <fileName> <variableName> -ASCII
will save variable to the file as ASCII format.
Checking for virables
who
command will list all variable names in the current scope, further more, whos
command will list all variable details as a table with attribute name, variable size, bytes and data type.
clear <variableName>
will release the attribute.
size(varName)
shows the size of variable.
Data type
Matrix
- Define1A = [1 2; 3 4; 5 6];
means
$$A=\begin{bmatrix}
1 && 2 \\
3 && 4 \\
5 && 6
\end{bmatrix}_{3\times2}$$
- Abstract1B = A([1 3],:);
$$B=\begin{bmatrix}
1 && 2\\
5 && 6
\end{bmatrix}$$
Get the first and the third row for all columns from A matrix as B matrix.
Diagonal matrix
eye(N)
is an $N\times N$ diagonal matrix.Ones and Zeros
ones(m, n)
means a matrix of $m$ rows and $n$ columns with all elements equal to one, similarly,zeros(m, n)
stands for a matrix of $m$ rows and $n$ columns with all elements equal to zero.Transpose
A'
is the transpose matrix of A matrix.
Draw
hist(var, N)
will draw a histagram with variable var
an divide into N pieces.
plot(x, y)
will draw a figure of (x,y) function.
|
|
The code above will draw y1 and y2(in red color) function together corresponding to x.
print
will save the figure as a file.
close
will close the figure.
|
|
The code above will plot the figures in two different figure with the given name.
|
|
|
|
Help
help <commandName>
can check the command usage.