# Set default values in matlab

The following Matlab project contains the source code and Matlab examples used for set default values.
In order to set default values for variables, I find the start of my functions littered with
if nargin < 1 || isempty(x)
x = 1;
end
if nargin < 2 || isempty(y)
y = 3;
end
etc.