>> ones(2:3)
ans =
1 1 1
1 1 1
>> 2*ones(2:3)
ans =
2 2 2
2 2 2
>> rand(3,3) 产生0~1中的随机数
ans =
0.359326 0.667090 0.241347
0.925524 0.999806 0.712061
0.464446 0.868639 0.015394
>> zeros(2,3)
ans =
0 0 0
0 0 0
>>
>> a = sqrt(10) 对10进行开方
a = 3.1623
>> v = sqrt(25)
v = 5
>> randn(2,3)
ans =
-0.816870 0.194866 -0.126516
-1.414071 0.033585 -1.123685
>> w=-6+sqrt(10)*randn(1,10000);
>> hist(w)
>> eye(4) 生成单位矩阵
ans =
Diagonal Matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1