In andrew's class , he talked about a software called octave. Its grammar is similar to matlab.Here are some examples on how to use it.
(1)Load data
In order to load the data into a matrix . First you should cd to the target directory. Then use "load xxx.mat"command xxx is the name of your file. After loading , there will be a matrix called xxx.
(2)Index
A is defined as a matrix. A(i,:) returns the ith row vector. A(:,j) returns the jth colunmn vector. A(:) returns a column vector For example

(3)matrix Espansion
For example:


(4)Search
For example ,find elements which are larger than 12

data(2,1) data(1,2) data(2,2) those elements are larger than 12 . r stands for rows , c stands for columns
How to find the max value of columns or rows

(6)Plot data
we use hold on command to plot one figure on top of other figures.
we use subplot(rows,cols,number) command to plot several figure into one window . Rows,cols mean how many rows and columns in this window . number means which one you want to plot.
we use imagesc(matrix name),colorbar ,colormap gray commands to visualize the matrix.
本文介绍了Octave软件的基本使用方法,包括数据加载、矩阵操作、查找特定元素、获取最大值及数据可视化等实用技巧。

被折叠的 条评论
为什么被折叠?



