% FUNCTION CHECK_PARAM(REQUIRED_PARAM, GIVEN_PARAM) function check_param(required_param, given_param) for a = 1:length( required_param ) aux( a ) = 0; for b = 1:length( given_param ) aux( a ) = aux( a ) | strcmp( required_param{ a }, given_param{ b } ); end end if ~all(aux) s = sprintf('Some of the required parameters are missing:'); v = required_param( ~aux ); for a = 1:length( v ) s = [ s sprintf( [ '\n ' v{ a } ] ) ]; end s = [ s sprintf( '\nAborted.') ]; error( s ); end