Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.1.0 - Português


fieldnames

get a tlist, mlist or struct fields names

Syntax

f = fieldnames(lst)

Arguments

lst

A tlist, mlist or struct variable.

f

Strings column vector of fields names.

Description

The fieldnames function returns field names of a tlist, mlist or struct. fieldnames does not work on cells.

As said in rational or syslin help pages, internal representation of some Scilab objects is a tlist (or rlist), so using fieldnames with them will return the generic forms of these objects. For example, for rationals, the function will return "num","den" and "dt".

Examples

fieldnames(tlist(['listtype', 'f1', 'f2'], [], []))
fieldnames(mlist(['V', 'key', 'value'], ['a' 'b' ; 'c' 'd'], [1 2 ; 3 4]))
fieldnames(struct('f1', 25, 'month', 'DEC', 'year', 2006))
obj.x = 3;
obj.y = 3;
fieldnames(obj)
fieldnames(1/%s)
fieldnames(tf2ss(1/%s))

See also

  • extraction — extração de entradas de matrizes e listas
  • getfield — extração de campos de listas
  • tlist — objeto do Scilab e definição de listas com tipos ("typed lists")
  • mlist — objeto Scilab, definição de listas com tipos orientadas matricialmente
  • struct — Builds a structure or an array of structures
Report an issue
<< definedfields Estruturas de Dados getfield >>

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:
Mon Jun 17 17:53:24 CEST 2024