function y = DoubleMe(x) % DoubleMe - double the value of the input % % This function doubles the value of its input. The input % may be a scalar, vector, or matrix and the result will % be of the same dimension as the input. % % Syntax: % y = DoubleMe(x) % % Author: BPP % Date: 9/30/02 % Check inputs if nargin ~=1 error('Function DoubleMe requires exactly one input.'); end if nargout > 1 error ('Function DoubleMe can have at most one output argument.'); end % Compute result y = 2*x;