Problem 2592. LocateMembership | Membership of Matrix in another matrix
Let a and b be given by
a = [ 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 4 0 0 0 ]
b = [ 2 1 1 1 2 1 1 1 2 ]
then b can be created using a (b is wholly present in a). So output should be location of central element of b in a.
Here output is [3,3] else it should be [0,0].
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Vishal
on 17 Sep 2014
@rifat : updated, thanks for info
Jan Orwat
on 18 Sep 2014
Nice problem. Some solutions (using conv, filter2 etc.) doesn't check conditions properly. Adding a=2*ones(4); b=3*eye(3)+1; or a=0; b=0; or similar can improve the testsuite;
Jean-Marie Sainthillier
on 18 Sep 2014
The solution in the example is [2 2;3 3].
Solution Comments
Show commentsProblem Recent Solvers22
Suggested Problems
-
1357 Solvers
-
386 Solvers
-
Given a window, how many subsets of a vector sum positive
857 Solvers
-
07 - Common functions and indexing 6
454 Solvers
-
1315 Solvers
More from this Author6
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!