複数の条件(文字)に一致するインデクスの取得方法

1列目がEat,2列目がRuminationである行番号を取得したいのですが,どうすればよろしいでしょうか?
ご教授よろしくお願いし致します.

 채택된 답변

madhan ravi
madhan ravi 2023년 12월 4일
편집: madhan ravi 2023년 12월 4일

0 개 추천

Row_number = find(strcmp(Data{:, 1}, 'Eat') & strcmp(Data{:, 2}, 'Rumination')) % Where Data is your Table

댓글 수: 5

madhan ravi
madhan ravi 2023년 12월 4일
편집: madhan ravi 2023년 12월 4일
Row_number = find(strcmp(Data(:, 1), 'Eat') & strcmp(Data(:, 2), 'Rumination')) % where Data is your cell array
Tadafumi Sugi
Tadafumi Sugi 2023년 12월 4일
こちら画像にはないのですが,”Stand”が入力された行もあるのですが,その場合どうすればよろしいでしょうか?
madhan ravi
madhan ravi 2023년 12월 4일
Please try my edited answer and comment
Tadafumi Sugi
Tadafumi Sugi 2023년 12월 4일
出来ました!
ありがとうございます.
Dyuman Joshi
Dyuman Joshi 2023년 12월 4일
Hello @Tadafumi Sugi, if this answer solved your problem, please consider accepting the answer.
Accepting the answer indicates that your problem has been solved (which can be helpful to other people in future) and it awards the volunteer with reputation points for helping you.
You can accept only 1 answer for a question, but you can vote for as many answers as you want. Voting an answer also provides reputation points.

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

추가 답변 (0개)

카테고리

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

질문:

2023년 12월 4일

댓글:

2023년 12월 4일

Community Treasure Hunt

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

Start Hunting!