Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -
Справка Scilab >> Linear Algebra > Matrix Analysis > cond

cond

condition number of a matrix

Syntax

c = cond(X)
c = cond(X, p)

Arguments

X

real or complex matrix. For the c = cond(X,p) syntax, X must be square.

p

1 | 2 | %inf | "inf" | "fro": Used norm. Default value = 2.

c

positive decimal number: the condition number.

Description

c = cond(X)

returns condition number in 2-norm.cond(X) is the ratio of the largest singular value of X to the smallest.

c = cond(X, p)

returns the condition number in p-norm : norm(X, p) * norm(inv(X), p). p possible values are:

1 : condition number in 1-norm.
2 : condition number in 2-norm.
%inf | "inf" : condition number in infinite norm
"fro" : condition number in Frobenius norm

Examples

// Condition number of a non-square matrix
cond([1 0 -1 ; 0 1 -1])

A = testmatrix('hilb',6);
// condition number in 2-norm
cond(A)
cond(A, 2)

// condition number in 1-norm
cond(A, 1)

// condition number in infinity norm
cond(A, %inf)

// condition number in Frobenius norm
cond(A, 'fro')

See also

  • rcond — inverse condition number
  • svd — singular value decomposition
  • norm — нормы вектора или матрицы

History

ВерсияОписание
5.4.0
  • cond(X) now accepts non square matrix.
  • New input argument p introduced.
6.0.2 cond([]) now returns 0 instead of 1.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:04:55 CET 2019