MATLAB: If the input (n) is not a number, i need to display an error message

errorinputintegernumber

function output=coa08xxx_master(x,n)
switch x
case 'plotlines'; output=coa08xxx_lines(n);
case 'plotfx'; output=coa08xxx_fx(n);
otherwise; output='input not valid';
end
this is the code, if the input n is not a number i need it do display an error message.

Best Answer

if ~isnumeric(n) | numel(n) ~= 0
error('n was not a number');
end