Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - 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 >> Data Structures > type

type

returns the type of a variable

Calling Sequence

[i]=type(x)

Arguments

x

a Scilab object.

i

an integer.

Description

type(x) returns an integer which is the type of x as following:

1

a real or complex matrix of double.

2

a polynomial matrix.

4

a boolean matrix.

5

a sparse matrix.

6

a sparse boolean matrix.

7

Matlab sparse matrix

8

a matrix of integers stored on 1 (int8), 2 (int16) or 4 (int32) bytes.

9

a matrix of graphic handles.

10

a matrix of character strings.

11

an un-compiled function (Scilab code). A function created with deff with argument 'n'.

13

a compiled function (Scilab code).

14

a function library.

15

a list.

16

a typed list (tlist).

17

a matrix oriented typed list (mlist).

128

a pointer (Use case: lufact).

129

a size implicit polynomial used for indexing.

130

a built-in Scilab function, called also gateway (C, C++ or Fortran code).

0

a null variable. It is mainly used internally by Scilab. If a function has no declared returned argument like disp when it is called it returns a null variable. If a function is called with an omitted argument in the argument list like foo(a,,b) the missing argument is assigned to a null variable.

Note that if a null variable is assigned to a name, it is removed. x=disp(1) deletes x.

Please note that, for some variables, type will return tlist or mlist due to the internal data structure. This is the case of rational and state-space matrices, uitree, hypermat and struct. Please considering the use of typeof instead.

Examples

a=42;
type(a)

b=%t;
type(b)

c="foo"
type(c)

d=sparse([1,2;4,5;3,10],[1,2,3]);
type(d)

e = tlist(["listtype","field1","field2"], [], []);
type(e)

f=poly(0,"s");
type(f)

g=int8([1 -120 127 312]);
type(g)

h=mlist(['V','name','value'],['a','b';'c' 'd'],[1 2; 3 4]);
type(h)

l = list(1,["a" "b"]);
type(l)

deff('[x]=mymacro(y,z)',['a=3*y+1'; 'x=a*z+y']);
type(mymacro)

deff('[x]=myplus(y,z)','x=y+z','n');
type(myplus)

See Also

  • typeof — object type
  • inttype — type integers used in integer data types
Report an issue
<< tlist Data Structures typename >>

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:
Fri Apr 11 14:06:54 CEST 2014