home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / TACKON.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  868 b   |  29 lines

  1. % function matout = tackon(mat1,mat2)
  2. %
  3. %   Concatenates two VARYING matrices, which must be
  4. %   of the same row and column dimension.
  5. %
  6. %   See also: GETIV, SORT, and SORTIV.
  7.  
  8. function matout = tackon(mat1,mat2)
  9.  if nargin ~= 2
  10.    disp(['usage: matout = tackon(mat1,mat2)']);
  11.    return
  12.  end
  13.  [typeone,rowone,colone,numone] = minfo(mat1);
  14.  [typetwo,rowtwo,coltwo,numtwo] = minfo(mat2);
  15.  if typeone ~= 'vary' | typetwo ~= 'vary'
  16.    disp('TACKON is only valid with two VARYING matrices')
  17.    return
  18.  end
  19.  if rowone ~= rowtwo | colone ~= coltwo
  20.    error('matrices must be the same dimensions')
  21.    return
  22.  end
  23.  indv = [mat1(1:numone,colone+1);mat2(1:numtwo,coltwo+1)];
  24.  data = [mat1(1:numone*rowone,1:colone);mat2(1:numtwo*rowtwo,1:coltwo)];
  25.  [nrd,ncd] = size(data);
  26.  matout = vpck(data,indv);
  27. %
  28. % Copyright MUSYN INC 1991,  All Rights Reserved
  29.