octave 使用小记

1. ones(X)   ones(N, M) 

% return a matrix or N-dimensional array whose elements are all 1.

2. zeros(X) zeros(N, M)

% return a matrix or N-dimensional array whose elements are all 0.

3. rand(X) rand(N, M)

% return a matrix with random elements uniformly distributed on the interval (0,1).

4. hist(Y, X, NORM)

% produce histogram counts or plots.

5. eye(X) eye(N, M)

% return an identity matrix.

6. pwd

% return the current working directory.

7. cd dir

% change the current working directory to DIR.

8. who

% list variables

9. A(:)

% put all elements of A into a single vector.

10. A * B

% multiple

11. A .* B

% multiple each element

12. A'

% matrix transpose

13. find

% example find specific rows

% idx = find(X(:, 2) == 8)

% Y = X(idx, :)

 

posted @ 2014-01-21 23:29  登山者  阅读(265)  评论(0编辑  收藏  举报