Check for column in table
57 ビュー (過去 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!