<< exp | QD: 32 bytes decimal arithmetics | qdgqr >>

DD_QD (MuPAT) >> DD_QD (MuPAT) > QD: 32 bytes decimal arithmetics > qdeye

# qdeye

Identity matrix

### Syntax

    a = qdeye(m,n)
    a = eye(QDmat)

### Parameters

m,n

  positive integers

QDmat

  matrix of QD numbers

a

  QD matrix of size [m,n] or size(QDmat), with QD ones on the diagonal.

### Description

qdeye(m,n)

  returns a `(m,n)` QD-encoded identity matrix.

### Examples

    qdeye(1,1)  // scalar
    qdeye(3,4)  // matrix

    q = qdrand(4,5);
    eye(q)

    --> qdeye(1,1)  // scalar
     ans  =
       1.00000000000000000000000000000000000000000000000000000000000000E0

    --> qdeye(3,4)  // matrix
     ans  =
    [d1]
       1.   0.   0.   0.
       0.   1.   0.   0.
       0.   0.   1.   0.
    [d2] zeros(3,4)
    [d3] zeros(3,4)
    [d4] zeros(3,4)

    --> q = qdrand(4,5);
    --> eye(q)
     ans  =
    [d1]
       1.   0.   0.   0.   0.
       0.   1.   0.   0.   0.
       0.   0.   1.   0.   0.
       0.   0.   0.   1.   0.
    [d2] zeros(4,5)
    [d3] zeros(4,5)
    [d4] zeros(4,5)

### See Also

- qdzeros — QD matrix made of zeros
- qdones — QD matrix made of ones
- qdrand — (Quasi) Pseudorandom QD number generator
- qd — builds an array of QD numbers

### Authors

Copyright (C) 2011 - Tsubasa Saito

Report an issue
<< exp | QD: 32 bytes decimal arithmetics | qdgqr >>