Learn R Programming

rstiefel (version 1.0.1)

NullC: Null Space of a Matrix

Description

Given a matrix M, find a matrix N giving a basis for the null space. This is a modified version of Null from the package MASS.

Usage

NullC(M)

Arguments

M

input matrix.

Value

an orthonormal matrix such that t(N)%*%M is a matrix of zeros.

Examples

Run this code
# NOT RUN {
NullC(matrix(0,4,2))

## The function is currently defined as
function (M) 
{
    tmp <- qr(M)
    set <- if (tmp$rank == 0L) 
        1L:nrow(M)
    else -(1L:tmp$rank)
    qr.Q(tmp, complete = TRUE)[, set, drop = FALSE]
  }

# }

Run the code above in your browser using DataLab