Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!e25g2000prg.googlegroups.com!not-for-mail
From: Randy Poe <poespam-trap@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: compare two rows, from different matrices
Date: Fri, 8 Feb 2008 08:55:42 -0800 (PST)
Organization: http://groups.google.com
Lines: 56
Message-ID: <78d45f1e-3720-4efe-87ed-43f755a8ca17@e25g2000prg.googlegroups.com>
References: <fohtuq$bog$1@fred.mathworks.com>
NNTP-Posting-Host: 192.35.37.20
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1202489744 27503 127.0.0.1 (8 Feb 2008 16:55:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 8 Feb 2008 16:55:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e25g2000prg.googlegroups.com; posting-host=192.35.37.20; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) 
X-HTTP-Via: 1.1 squid.atl.lmco.com:3128 (squid/2.5.STABLE14)
Xref: news.mathworks.com comp.soft-sys.matlab:450180


On Feb 8, 10:54 am, "Marcel " <JMarc...@gmail.com> wrote:
> Hello
>
> I have a problem with comparing two rows of two differents
> matrices.
> I have matrix A, size is [1024,8]
> the size of matrix B is [7,8]
> Both matrix A and B store only binary numbers.
>
> I need to compare every row from A, with each row from B.
> For example :
> 1.row from A compare with 1. row from B
>                 then with 2.row from B
>                       ..
>                       ..
>                      with 7. row from B
>
> then make another matrix TEMP with size [1024,8]
> The  row from B that is most similar to 1. row from A, give
> to the 1. row of TEMP
>
> 2.row from A compare with 1. row from B
>                 then with 2.row from B
>                       ..
>                       ..
>                      with 7. row from B
> The  row from B that is most similar to 2. row from A, give
> to the 2. row of TEMP
> ..
> ..
> ..
> ..
> 1024.row from A compare with 1. row from B
>                    then with 2.row from B
>                         ..
>                         ..
>                         with 7. row from B
> The  row from B that is most similar to 1024. row from A,
> give to the 1024. row of TEMP
>
> so I should have a new matrix TEMP , which contains from B rows
>  Can somoen help me, I have own script, but he just compare
> all elements from A with 1. row from B

Then perhaps you need a second loop which
chooses the row of B. Sounds like the structure
should be something like this:

for rowA = 1:1024
   for rowB = 1:7
      compare A(rowA,:) and B(rowB,:)
   end
   store winner in TEMP at rowA
end

            - Randy