How do I search whether a column, lets say 'Column1', exists in a table, Table_1, without using strmatch as it is not recommended.

답변 (2개)

Kevin Phung
Kevin Phung 2019년 7월 10일
편집: Kevin Phung 2019년 7월 10일

0 개 추천

any(ismember(Table_1.Properties.VariableNames,'Column1'))
strcmp works too, in place of ismember
Shubham Sangle
Shubham Sangle 2019년 7월 10일

0 개 추천

Exist_Column = strcmp('My_Column',My_Table.Properties.VariableNames)
val = Exist_Column(Exist_Column==1) ;

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

태그

질문:

2019년 7월 10일

답변:

2019년 7월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by