why isfield does not work with tables, but fieldnames does?

7 次查看(过去 30 天)
in 2014a
Example:
>> istable(t)
ans =
1
>> t
t =
a b c
_ _ _
1 2 3
>> isfield(t,'a')
ans =
0
>> any(strcmp('a',fieldnames(t)))
ans =
1
  1 个评论
Roger Parkyn
Roger Parkyn 2015-9-15
Yes - it is something they have missed. Thank you for the work-around with: any(strcmp('a',fieldnames(t)))

请先登录,再进行评论。

回答(2 个)

the cyclist
the cyclist 2015-9-16
That does seem inconsistent. It has the same behavior for dataset objects as well.

Walter Roberson
Walter Roberson 2015-9-16

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by