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 日

0 投票

Do you want this?
d=C(C(:,2) == 1 & C(:,3) == 2)

2 件のコメント

Jonas
Jonas 2021 年 7 月 10 日
probably
d=C(C(:,2) == 1 & C(:,3) == 2,:)
abdul rehman
abdul rehman 2021 年 7 月 10 日
yes exactly

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by