Home > atmlab > handy > rqre_same_size.m

rqre_same_size

PURPOSE ^

RQRE_SAME_SIZE Checks that two variables have exactly the same size

SYNOPSIS ^

function rqre_same_size(a, b)

DESCRIPTION ^

 RQRE_SAME_SIZE   Checks that two variables have exactly the same size

    Issues an error if criterion not fulfilled.

    Only sizes are compared and *a* and *b* can be of different types.

 FORMAT   rqre_same_size( a, b )
        
 IN    a   A variable
       b   A second variable

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

rqre_same_size.m

SOURCE CODE ^

0001 % RQRE_SAME_SIZE   Checks that two variables have exactly the same size
0002 %
0003 %    Issues an error if criterion not fulfilled.
0004 %
0005 %    Only sizes are compared and *a* and *b* can be of different types.
0006 %
0007 % FORMAT   rqre_same_size( a, b )
0008 %
0009 % IN    a   A variable
0010 %       b   A second variable
0011 
0012 % 2010-01-04   Created by Patrick Eriksson.
0013 
0014 function rqre_same_size(a, b)
0015 
0016 if any(size(a) ~= size(b))
0017   error(['atmlab:' mfilename], ...
0018       'The variables %s and %s must have the same size. Sizes found: %s %s', ...
0019         inputname(1), inputname(2), ...
0020         mat2str(size(a)), mat2str(size(b)));
0021 end
0022 
0023 end

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