multiple conditions in matrix

12 次查看(过去 30 天)
I am receiving this error while applying multipe conditions in matrix
Code:
C= [rand(100,1),randi([0,2],100,1),randi([0,2],100,1),randi([5,12],100,1)]
d=C(C(:,2) == 1,: && (:,3) == 2, :)

采纳的回答

Simon Chan
Simon Chan 2021-7-10
编辑:Simon Chan 2021-7-10
Do you want this?
d=C(C(:,2) == 1 & C(:,3) == 2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Math 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by