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

probably
d=C(C(:,2) == 1 & C(:,3) == 2,:)
abdul rehman
abdul rehman 2021년 7월 10일
yes exactly

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 7월 10일

댓글:

2021년 7월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by