Home > atmlab > retrieval > splitA.m

splitA

PURPOSE ^

SPLITA Splits up an averaging kernel matrix

SYNOPSIS ^

function As = splitA(A,ji)

DESCRIPTION ^

 SPLITA   Splits up an averaging kernel matrix

 FORMAT   As = splitA( A, ji )
        
 OUT   As   Array of matrices. One matrix for each retrieval quantity. 
 IN    A    Complete averaging kernel matrix.
       ji   Matrix of two columns, where the columns hold start and end index
            for each retrieval quantity.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

splitA.m

SOURCE CODE ^

0001 % SPLITA   Splits up an averaging kernel matrix
0002 %
0003 % FORMAT   As = splitA( A, ji )
0004 %
0005 % OUT   As   Array of matrices. One matrix for each retrieval quantity.
0006 % IN    A    Complete averaging kernel matrix.
0007 %       ji   Matrix of two columns, where the columns hold start and end index
0008 %            for each retrieval quantity.
0009 
0010 % 2006-09-29   Created by Patrick Eriksson.
0011 
0012 
0013 function As = splitA(A,ji)
0014                                                                             %&%
0015 rqre_nargin( 2, nargin );                                                   %&%
0016 if ~istensor2(A)  |  size(A,1)~=size(A,2)                                   %&%
0017   error( 'Input argument *A* must be a square matrix.' );                   %&%
0018 end                                                                         %&%
0019 if ~istensor2(ji)  &  size(ji,2)                                            %&%
0020   error( 'Input argument *ji* must be a matrix with 2 columns.' );          %&%
0021 end                                                                         %&%
0022 if ji(end,2) ~= size(A,1)                                                   %&%
0023   error( 'Inconsistency between *A* and *ji*.' );                           %&%
0024 end                                                                         %&%
0025 
0026 for i = 1:size(ji,1)
0027   ind   = ji(i,1) : ji(i,2);
0028   As{i} = A(ind,ind);
0029 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005