or() in categorical variable
显示 更早的评论
I don't know why the results of index1 and index2 are different.
The variable
financial_status=[1,2,3,4,5];
index1 = find(financial_status==or(1,2));
index2 = find(financial_status>=1&financial_status<=2);
采纳的回答
更多回答(1 个)
Walter Roberson
2020-11-23
编辑:Walter Roberson
2020-11-23
ismember(financial_status, 1:2)
At the moment I cannot think of any computer language that expresses a set membership test in terms of an equality test. Which computer language were you inspired by?
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!