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

조회 수: 13 (최근 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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by