Home > atmlab > handy > rqre_subset.m

rqre_subset

PURPOSE ^

For two cell arrays, require that one is subset of other

SYNOPSIS ^

function rqre_subset(small, large)

DESCRIPTION ^

 For two cell arrays, require that one is subset of other

 FORMAT

   rqre_subset(small, large)

 IN

   small       array that should be a subset
   large       array that should be a superset

 No output arguments, but throws an error if it fails.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

rqre_subset.m

SOURCE CODE ^

0001 function rqre_subset(small, large)
0002 
0003 % For two cell arrays, require that one is subset of other
0004 %
0005 % FORMAT
0006 %
0007 %   rqre_subset(small, large)
0008 %
0009 % IN
0010 %
0011 %   small       array that should be a subset
0012 %   large       array that should be a superset
0013 %
0014 % No output arguments, but throws an error if it fails.
0015 
0016 % $Id: rqre_subset.m 8377 2013-04-25 16:00:02Z gerrit $
0017 
0018 errId = ['atmlab:' mfilename ':notasubset'];
0019 
0020 for elem = small
0021     if ~ismember(elem{1}, large)
0022         error(errId, ...
0023             '%s must be subset of %s but is not', ...
0024             inputname(small), inputname(large));
0025     end
0026 end
0027 
0028 end

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