Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> 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 — norms of a vector or a matrix

History

VersionDescription
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.
Report an issue
<< Matrix Analysis Matrix Analysis det >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 14:57:13 CET 2019