Home > utils > emptyOrTextScalar.m

emptyOrTextScalar

PURPOSE ^

SYNOPSIS ^

function mustBeEmptyOrTextScalar(x)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mustBeEmptyOrTextScalar(x)
0002     if isempty(x)
0003         return;
0004     end
0005     if isstring(x)
0006         if ~isscalar(x), error('Value must be a string scalar or empty.'); end
0007     elseif ischar(x)
0008         if ~isrow(x), error('Char input must be a row vector or empty.'); end
0009     else
0010         error('Value must be a string/char scalar or empty.');
0011     end
0012 end

Generated by m2html © 2005