From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Finding a small matrix in larger one
Date: Wed, 08 Feb 2012 15:24:22 -0600
Organization: NNTP Server
Lines: 28
Message-ID: <jgup63$pob$>
References: <jgu4lt$8f4$> <jgukme$e8k$> <jgunu4$t6j$>
NNTP-Posting-Host: yYONfaJqtKgW9SB89zd/
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20110616 Thunderbird/3.1.11
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:757165

On 2/8/2012 3:02 PM, camilla belle wrote:
> For unique numbers it will work but for repeated it will show every number
> from B that equals one from A.

That's true...

You didn't specify the application.

But, the above was shown to demonstrate one starting point containing 
the necessary information--add the logic to the above to test that there 
is an area of the size of the smaller within the area that is all TRUE, 
essentially by deleting contiguous rows in which all elements are 0 and 
see if can end up w/ a sub-array the size of the target which satisfies 

The more a priori knowledge you have regarding the location of such a 
subarray within the larger, the more you can streamline the process--if, 
for example, you knew there can't be row in the middle of the subarray 
if it exists that is not part of that array, then you can use any() and 
all() w/ the dimension arguments and set the found rows/columns = [] w/o 
additional checking, just using the found indices.  If, otoh, you could 
have a row (say) that is all false in the middle of a pattern and that 
eliminating that row would create a false subarray, then you would need 
to only eliminate rows/columns that are not inside a potential area, 
much like Roger's solution.