How do I find the submatrix of a matrix?
Afficher commentaires plus anciens
I'm new to Matlab so bear with me.
If I have a 2D matrix A and a submatrix B of A. How can I check if B is a submatrix of A?
I basically want to search for matrix B in A.
An example with code would be appreciated :)
Réponse acceptée
Plus de réponses (1)
[R,P] = ismember(B,A)
if R contains all ones then B is a submatrix of A and P contains the indices of A where B is located, ie A(P) = B
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!