Special Matrix

 

Matrix of Ones, Matrix of Zeros,Matrix with Ones on the main diagonal, Identity Matrix


A

1

=ones(3,2)

2

=zeros(3,2)

3

=eye(3,4)

4

=I(3)

A1 Create a 3-by-2 matrix of ones.

..

A2 Create a 3-by-2 matrix of zeros.

..

A3 Create a 3-by-4 matrix with ones on the main diagonal.

..

A4 Create a 4-by-4 identity matrix with ones on the main diagonal and zeros else where

..