Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - English


mtlb_isfield

Matlab isfield emulation function

Description

There is no Scilab equivalent function for Matlab isfield(st,f) and equivalent expressions behave differently in some particular cases:

  • If st is not a structure: Scilab equivalent returns an error message but Matlab returns 0.

The function mtlb_isfield(st,f) is used by mfile2sci to replace isfield(st,f) when it was not possible to know what were the inputs while porting Matlab code to Scilab. This function will determine the correct semantic at run time. If you want to have a more efficient code it is possible to replace mtlb_isfield calls:

  • If st is a structure tf = mtlb_isfield(st,f) may be replaced by allf=getfield(1,st);tf=or(allf(3:$)==f);

  • If st is not a structure tf = mtlb_isfield(st,f) may be replaced by tf=%F;

Caution: mtlb_isfield has not to be used for hand coded functions.

See also

Report an issue
<< mtlb_isa Compatible fonctions mtlb_isletter >>

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:
Thu Oct 24 11:13:15 CEST 2024