returns the type of a variable
[i]=type(x)
a Scilab object.
an integer.
type(x) returns an integer which is the type of x as following:
a real or complex matrix of double.
Matlab sparse matrix
a matrix of integers stored on 1 (int8), 2 (int16) or 4 (int32) bytes.
a matrix of graphic handles.
a matrix of character strings.
an un-compiled function (Scilab code). A function created with deff with argument 'n'.
a compiled function (Scilab code).
a function library.
a list.
a typed list (tlist).
a matrix oriented typed list (mlist).
a pointer (Use case: lufact).
a size implicit polynomial used for indexing.
a built-in Scilab function, called also gateway (C, C++ or Fortran code).
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. |
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) | ![]() | ![]() |