I have matrix A with 1×10 elements and B with 1×125 elements. But elements in B are those elements in A only but randomly distributed. Now I want to get the row number of each element in B corresponding to matrix A.. can anybody help me .. thanks in advance

 Akzeptierte Antwort

Ive J
Ive J am 8 Dez. 2020

0 Stimmen

[idxB, idxA] = ismember(B, A);
idxA is index of A members in B.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by