isfield.m

来自「神经元信号处理软件」· M 代码 · 共 16 行

M
16
字号
function tf = isfield(s,f)
%ISFIELD True if field is in structure array.
%   F = ISFIELD(S,'field') returns true if 'field' is the name of a field
%   in the structure array S.
%
%   See also GETFIELD, SETFIELD, FIELDNAMES.


if isa(s,'struct') | isa(s, 'datastrm') 
  tf = any(strcmp(fieldnames(s),f));
else
  tf = logical(0);
end


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?