http://blog.sina.com.cn/s/blog_c8830d820101cn79.html
调用格式:
tf = isfield(S, 'fieldname')
tf = isfield(S, C)
程序示例
close all; clear; clc;
student =
struct('name', 'John', 'age', 20, 'score', 90);
isfield(student, {'name', 'salary', 'score'})
输出结果:
Is 'name' a field of student
structure? 1
Is 'salary' a field of student
structure? 0
ans = 1 0 1