Friday, 11 May 2012

zeros and ones 
ones to generate an array in which the value of elements are 1;
zeros to generate an array in which the value of elements are 0;

ones(2,4) two rows * four columns all one
1 1 1 1
1 1 1 1

ones(3) 
1 1 1
1 1 1
1 1 1

访问矩阵
假设 A=
1 2 3
2 2 2
4 4 4
访问A的第一行,第二列
A(1,2) = 2