find doesn't work with tables
显示 更早的评论
hello
I'm trying to find the index vector of where appears a value in a one column of a table (not an array nor a cell).
However, "find" gives me the error shown on the snapshot.

Any ideas
采纳的回答
更多回答(2 个)
Peter Perkins
2017-3-27
1 个投票
find isn't going to work on a table, but it will work on the contents of a table. So Guillaume, is right that if you're looking for values in one variable, use dot subscripting.
Those strings, and the fact that you're searching for multiple hits for a single value, leads me to think you should be using categorical for the strings. And then when you get to the point when you need to find all the groups of rows in the table, not just one, you can easily use varfun or rowfun with that categorical as a grouping variable. Hard to give specific advice without knowing where you're headed.
Walter Roberson
2017-3-26
0 个投票
If you are going to use variable number instead of variable name then you need to use {:,1} instead of (:,1)
2 个评论
Abdelmoumen Bacetti
2017-3-27
Walter Roberson
2017-3-27
indexes = find(big_table{:,1} == t1_u{1,1});
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
