Check for column in table
조회 수: 37 (최근 30일)
이전 댓글 표시
How do I search whether a column, lets say 'Column1', exists in a table, Table_1, without using strmatch as it is not recommended.
댓글 수: 0
답변 (2개)
Kevin Phung
2019년 7월 10일
편집: Kevin Phung
2019년 7월 10일
any(ismember(Table_1.Properties.VariableNames,'Column1'))
strcmp works too, in place of ismember
댓글 수: 0
Shubham Sangle
2019년 7월 10일
Similar questions with accepted answer is available at https://in.mathworks.com/matlabcentral/answers/313776-how-to-check-whether-a-column-exist-in-a-table
Exist_Column = strcmp('My_Column',My_Table.Properties.VariableNames)
val = Exist_Column(Exist_Column==1) ;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!