关于Octave中的常用命令笔记
注:每次使用的时候,都需要到网上各种搜索,太痛苦了,专门放一个地方,以方便自己查阅。
所有的i,j之类的小写代表常量,大写的X,Y代表矩阵或者向量
1、矩阵及向量:
ones(i,j):
zeros(i,j)
pinv(X):
X’:
find(条件):
示例用户:将Y向量中的0,与1分开。 Y1=find(Y1); Y0=find(Y0);
则X条件矩阵中的对于结果1的记录集,就可以使用X(Y1,:)来标识。
2、矩阵及向量运算:
3、plot画图:
plot(x1(y1,2),x1(y1,3),’+’);
hold on
plot(x1(y0,2),x1(y0,3),‘o’,‘MarkerFaceColor’,‘r’);
Format arguments:
linestyle
‘-’:Use solid lines (default).
‘–’:Use dashed lines.
‘:’:Use dotted lines.
‘-.’:Use dash-dotted lines.
marker
‘+’:crosshair
‘o’:circle
‘*’:star
‘.’:point
‘x’:cross
‘s’:square
‘d’:diamond
‘^’:upward-facing triangle
‘v’:downward-facing triangle
‘>’:right-facing triangle
‘<’:left-facing triangle
‘p’:pentagram
‘h’:hexagram
color
‘k’:blacK
‘r’:Red
‘g’:Green
‘b’:Blue
‘y’:Yellow
‘m’:Magenta
‘c’:Cyan
‘w’:White