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

7 ビュー (過去 30 日間)
Pawel Kusmierek
Pawel Kusmierek 2014 年 3 月 26 日
回答済み: Walter Roberson 2015 年 9 月 16 日
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 Center および File ExchangeStructures についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by