Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語

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

Scilab help >> Elementary Functions > size

size

size of objects

Calling Sequence

y=size(x [,sel])
[nr,nc]=size(x)

Arguments

x

matrix (including transfer matrix) or list or linear system (syslin)

y

1x2 integer vector or integer number

sel

a scalar or a character string

nr,nc

two integers

Description

Applied to :

a matrix (constant, polynomial, string, boolean, rational) x, with only one lhs argument size returns a 1x2 vector [number of rows, number of columns]. Called with LHS=2, returns nr,nc = [number of rows, number of columns]. sel may be used to specify what dimension to get:

1 or 'r'

to get the number of rows

2 or 'c'

to get the number of columns

'*'

to get the product of rows and column numbers

Applied to:

a list it returns the number of elements. In this case only y=size(x) syntax can be used

Applied to:

a linear system, y=size(x) returns in y the (row) vector [number of outputs, number if inputs] i.e. the dimension of the corresponding transfer matrix. The syntax [nr,nc]=size(x) is also valid (with (nr,nc)=(y(1),y(2)). If x is a linear system in state-space form, then [nr,nc,nx]=size(x) returns in addition the dimension nx of the A matrix of x.

Applied to:

an hypermatrix, y=size(x) returns the vector of hypermatrix dimensions. [n1,n2,...nn]=size(x) returns the hypermatrix dimensions. ni=size(x,i) returns the ith dimension and size(x,'*') returns the product of dimensions.

Examples

[n,m]=size(rand(3,2))
[n,m]=size(['a','b';'c','d'])
x=ssrand(3,2,4);[ny,nu]=size(x)
[ny,nu]=size(ss2tf(x))
[ny,nu,nx]=size(x)

// Returns the number of rows
n=size(rand(3,2),"r")
// Returns the number of columns
m=size(rand(3,2),"c")
// Returns the product of the dimensions
nm=size(rand(3,2),"*")

See Also

  • length — length of object
  • syslin — linear system definition
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:44:14 CEST 2011