Scilab 6.1.0
      
      
    Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
typeof
tipo do objeto
Seqüência de Chamamento
t = typeof(object) oc = typeof(object, "overload")
Parâmetros
- object
- objeto Scilab 
- t
- a string (may have spaces): the name of the type of - object
- oc
- a string (without spaces): the name of the overloading code for the - object.
Descrição
t = typeof(object) retorna um dos seguintes
            strings:
| string | objecté uma matriz ou hipermatriz de
                    caracteres e/o textos. | ||
| boolean | objecté uma matriz ou hipermatriz de valores
                    booleanos. | ||
| int8 ou int16 ou int32 ou int64 ou uint8 ou uint16 ou uint32 ou uint64 | |||
| objectis a matrix or hypermatrix of [unsigned]
                    integers stored
                    on 8, 16, 32 or 64 bits. (see inttype) | |||
| constant | objecté uma matriz ou hipermatriz
                    de números reais ou complexos | ||
| polynomial | objecté uma matriz ou hipermatriz de
                    polinômios
                    com coeficientes reais ou complexos. | ||
| rational | objecté uma matriz ou hipermatriz de
                    razões
                    de polinômios (matriz de transferência), com coeficientes
                    reais ou complexos. | ||
| handle | objectis a graphics
                    handle.
                    The subtype of graphics handles (Figure, Axes, Polyline,
                    Compound, etc) is available in their.typeproperty. See examples below. | ||
| list | objecté uma
                    lista. | ||
| st | objecté uma
                    estrutura ou
                    um nD-array de estruturas. | ||
| ce | objecté uma célula
                    ou um nD-array de células. | ||
| boolean sparse | objecté uma matriz de valores
                    booleanos esparsa.
 | ||
| sparse | objecté uma matriz
                    esparsa de números
                    reais ou complexos.
 | ||
| "Matlab sparse" | objectis a Matlab-like-encoded sparse
                    matrix (see mtlb_sparse()). | ||
| fptr | objectis a built-in Scilab function,
                    called also gateway
                    (C, C++ or Fortran code), a.k.a. a primitive. | ||
| function | objectis a function
                    (Scilab code). See also deff. | ||
| library | objectis a
                    library
                    of functions in Scilab language. | ||
| pointer | objecté um ponteiro (ver
                    lufact). | ||
| implicitlist | objecté um polinômio de tamanho
                    implícito para indexação.
                    Ver  n:$ e
                    : (colon) | ||
| listdelete | is returned by typeof(.
                    See  null(). | ||
| void | is the typeof undefined elements in lists. | ||
| Typed T-Lists or M-Lists: | |||
| Note that if the objectis a
                    tlist
                    or a mlist,typeofwill return the corresponding customized type stored in as a
                    string in the first list entry. | |||
| Reserved T-List or M-List types predefined in Scilab: | |||
| dir | objectis the result of a
                    dir()
                    instruction, with fieldsname,date,bytes, andisdir. | ||
| state-space | objectis a state-space model
                    (see syslin). | ||
| program | objectis a list describing the internal code of a function
                    (see macr2tree). | ||
| cblock | objectis a block of columns of same
                    heights but of different data types, as returned by
                    mfscanf. | ||
| XMLDoc | objectis an XML Document created with
                    xmlRead,
                    xmlReadStr,
                    htmlRead, or
                    htmlReadStr.
                    Additional XML typeof are defined. | ||
| H5Object | objectis the id of an HDF5 file opened
                    with h5open.
                    Additional HDF5 typeof are defined:
                    See HDF5 Objects. | ||
| uitree | objectis a tree, a branch or a leaf as created with  a
                    uitree feature. See for instance uiCreateNode. | ||
| Reserved T-list types used in Xcos : | |||
| Block | objectis a Xcos block. | ||
| cpr | objectis a tlist containing the compilation results of a Xcos diagram. | ||
| diagram | objectis a tlist defining a Xcos diagram: initial parameters,
                set of blocks, of links between blocks, and of Text labels belonging to the diagram. | ||
| graphics | objectis a tlist assigned to the.graphicsfield of a block. | ||
| Link | objectis a tlist defining and configuring a link between 2 blocks. | ||
| model | objectis a tlist assigned to the.modelfield
                of a block. | ||
| params | objectis a tlist containing some configuration parameters of a
                Xcos diagram. | ||
| scsopt | objectis a tlist containing the graphical options of the Xcos
                diagram editor. | ||
| scs | objectis a tlist containing static results of the compilation of
                a Xcos diagram. | ||
| xcs | objectis a tlist containing dynamical results during a Xcos
                simulation. | ||
| Text | objectis a tlist defining a text label in a Xcos diagram. | ||
Exemplos
// Characters and texts t = ["a" "Hello" "à é è ï ô û ñ" "1" "Bonjour" "указывает тип объекта" ";" "Chao" "オブジェクトの型" ] typeof(t) // Booleans typeof(%t) typeof("abc"=="def") hm = grand(2,2,2,"uin",0,9)<5 typeof(hm) // Encoded integers [ typeof(uint8(%pi)) typeof(int8(-%pi)) typeof(uint16(%pi)) typeof(int16(-%pi)) typeof(uint32(%pi)) typeof(int32(-%pi)) typeof(uint64(%pi)) typeof(int64(-%pi)) ] // Decimal numbers n = 1:0.3:2 typeof(n) hm = grand(2,2,2,"uin",0,9) typeof(hm) // Decimal integers n = 1:7 typeof(n) // Complex numbers n = [%i 1-%i %pi - 3*%i] typeof(n) // Special "constant" typeof([]) // empty matrix // Polynomials n = [ %z (1-%z)^2] typeof(n) n = [ 3*%i + %z (1-%i*%z)^2] typeof(n) // Rational fractions r = [%s/(1-%s) (1+%s)^2/(1-%s)] // with real coefficients typeof(r) r = [%s/(%i-%s) (%i+%s)^2/(1-%s)] // with complex coefficients typeof(r) // Sparse matrices // --------------- w = sprand(100,100,0.001) typeof(w) // sparse typeof(w==w) // boolean sparse //x = mtlb_sparse(sprand(10,10,0.1)); //typeof(x) // Functions and libraries // ----------------------- deff('y=f(x)','y=2*x'); // Function in Scilab language f(%pi) typeof(f) typeof(cosd) // written in Scilab typeof(corelib) // Library of functions in Scilab language typeof(sin) // Built-in function (non-editable) mysin = sin; mysin(%pi/2) // Graphical handles // ----------------- clf plot2d() typeof(gcf()) // The subtype of the handle is in the "type" property: gcf().type gca().type gce().type close(gcf()) // Containers // ---------- // Simple list L = list(%pi, %t, %z, %s/(1-%s), "Bonjour", sin, cosd, list("list_in_list", 432)); typeof(L) // Cells array C = {%pi, %t, %z ; %s/(1-%s), "Bonjour", list("list_in_list", 432) } typeof(C) // (Array of) Structure S.num = %pi; S.b = %t; S(2).t = "Bonjour" typeof(S) // Special generic indexing expressions // ------------------------------------ typeof($) typeof(:) // "eye()" equivalent (all elements) typeof(3:$) // Typeof for deletion or undefined elements: // ----------------------------------------- typeof([]) // empty matrix typeof(null()) L = list(%pi, ,"hey!") typeof(L(2)) // undefined element // Customized typeof of T-Lists: // ---------------------------- L = tlist(['myLongTypeOf','a','b'], 18, 'Scilab'); typeof(L) // Reserved T-List typeof // ---------------------- typeof(dir()) // Files directory // c = macr2tree(sind); // Internal code of a Scilab macro typeof(c) fieldnames(c)' c.name // doc = xmlReadStr("<root><a att=""foo"">Hello</a></root>"); typeof(doc) xmlDelete(doc) // x = 1; save(TMPDIR + "/x.sod", "x"); // SOD files are HDF5 ones a = h5open(TMPDIR + "/x.sod"); typeof(a) h5close(a)
Ver Também
- type — tipo de variável
- inttype — tipos de dados inteiros
- overloading — capacidades de overloading ("sobrecarga") de exibições, funções e operadores
- isreal — verifica se uma variável é armazenada como real ou complexa.
- strings — objeto Scilab, strings (cadeias de caracteres)
- poly — Polynomial definition from given roots or coefficients, or characteristic to a square matrix.
- rlist — definição de função racional do Scilab
- null — deletes a list component or a field of a structure, Mlist, or Tlist
- sparse — definição de matriz esparsa
- issparse — tests whether the input is sparse encoded (numeric or boolean)
- mtlb_sparse — converte matriz esparsa
- syslin — definição de sistemas lineares
- dir — gets file list
- XML Objects — Describe the properties of the different XML objects
- HDF5 Objects — Describe the properties of the different H5 objects
Histórico
| Version | Description | 
| 6.0 | 
 | 
| Report an issue | ||
| << typename | types | Variables >> | 
