how to find the position of a char matrix where the value is equal to an another matrix

조회 수: 2 (최근 30일)
hi, I have two char arrays (of different lenght)
A=['1207';'1106';'1209';'1602';'1501';'1235';'2341';'1927'];
B=['1106';'1602';'1207';'1501';'1235'];
I need something that for every row of matrix B evaluates which is the position of the same number in the matrix A.
The important thing is to compare the rows of both matrices as they are a single value (matrix B is a 5x4 and i need to consider it as it is a 5x1 vector. Same for A)
i tried both the find and intersection function, but i'm not getting the desired output...

채택된 답변

Jiri Hajek
Jiri Hajek 2022년 12월 7일
Hi, for this purpose you can use ismember function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by