Path: news.mathworks.com!not-for-mail
From: "charles atlas" <mufasa1234555@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Matrix matching
Date: Thu, 13 Aug 2009 17:55:30 +0000 (UTC)
Organization: suny binghamton
Lines: 108
Message-ID: <h61k2i$p69$1@fred.mathworks.com>
Reply-To: "charles atlas" <mufasa1234555@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250186130 25801 172.30.248.38 (13 Aug 2009 17:55:30 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Aug 2009 17:55:30 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1924889
Xref: news.mathworks.com comp.soft-sys.matlab:563171


I have two data sets 
A = 
1 23 345
1 45 636
1 65 672
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
3 39 445
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

B =
1 23 345
1 45 636
1 65 672
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
3 39 445
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

Obviously these two data sets are the same.
However, sometimes I will have two data sets that are slightly off where A would have one two or three less rows than B or vice versa as shown:
A = 
1 23 345
1 45 636
1 65 672
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
3 39 445
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

B =
1 23 345
1 45 636
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

What I would like to do is make it so that they have the same number of rows (possibly by inserting  a row of zeros)  anytime this problem occurs.
Final result would look like this:
 
A = 
1 23 345
1 45 636
1 65 672
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
3 39 445
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

B =
1 23 345
1 45 636
0 00 000
2 26 985
2 86 350
3 34 452
3 98 768
3 56 665
0 00 000
4 34 678
5 65 123
5 17 435
5 78 198
6 23 234
6 44 760

If anyone knows how to do this, Help is greatly appreciated
-Charlie