How to quickly obtain the row indices in the original matrix A for a sub-matrix B?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Benson Gou
am 2 Feb. 2021
Kommentiert: Benson Gou
am 3 Feb. 2021
Dear All,
I have an original matrix A and a sub-matrix which is formed by selected rows from A. Now given A and B, how can I find out the row indices of B in A?
For example,
A = [
0 0 1 0 -1
2 -1 0 0 0
-1 0 -1 0 0
0 0 3 -1 -1
0 0 -1 1 0
0 0 -1 0 1
];
B = [
0 0 1 0 -1
0 0 3 -1 -1
0 0 -1 1 0
0 0 -1 0 1
];
The indices should be ind = [1 4 5 6].
Thanks a lot.
Benson
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!