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

7 vues (au cours des 30 derniers jours)
Pawel Kusmierek
Pawel Kusmierek le 26 Mar 2014
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 commentaire
Roger Parkyn
Roger Parkyn le 15 Sep 2015
Yes - it is something they have missed. Thank you for the work-around with: any(strcmp('a',fieldnames(t)))

Connectez-vous pour commenter.

Réponses (2)

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

Walter Roberson
Walter Roberson le 16 Sep 2015

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by