octave编辑工具:sublime Text2,切换成Matlab
IDE(可debug):GUI OCTAVE;xOctave(免费30天);Domain Math IDE(debug时,编辑窗口和其他窗口不在一起,切换麻烦)
停止执行代码
CTRL+C
随机数生成
%产生1到m之间的随机数生成器
rand_indices = randperm(m);
%生成100个,返回一个向量
sel = X(rand_indices(1:100),:);
判断变量是否存在,是否非空
~exist('example_width', 'var') || isempty(example_width)
像素点绘图
colormap(gray);
%第一个参数是像素点矩阵
h = imagesc(display_array, [-1 1]);
% Do not show axis
axis image off
drawnow;
向量变矩阵
reshape(X(curr_ex, :), example_height, example_width)
max函数,获取行最大值下标
[mhx,p] = max(hx2,[],2);