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

  1. %function cm = blknrms(mat,blk)
  2. %
  3. %   Takes block by block norms of matrix MAT.
  4. %   BLK represents the block structure associated with MAT.
  5. %
  6. %   See also: BLKNORM, MU, PKVNORM, VNORM, and VSVD.
  7. function cm = blknrms(mat,blk)
  8.  
  9. [mrows,mcols] = size(mat);
  10. [nblk,dum] = size(blk);
  11.   for i=1:nblk
  12.     if blk(i,2)==0
  13.        blk(i,2)=blk(i,1);
  14.     end %if
  15.   end %for
  16.   [blkp,repp,fulp,wd,wpert,nrd,ncd] = ptrs(blk);
  17.      % see PTRS for definitions of these variables
  18.   if nrd ~= mcols | ncd ~= mrows
  19.     error('MATIN dimensions incompatible with BLK dimensions')
  20.     return
  21.   end
  22.  
  23.  for i=1:nblk
  24.    for j=1:nblk
  25.      cm(i,j) = norm(mat(blkp(i,2):blkp(i+1,2)-1,blkp(j,1):blkp(j+1,1)-1));
  26.    end
  27.  end
  28.  
  29. %
  30. % Copyright MUSYN INC 1991,  All Rights Reserved
  31.