%% Create Function Wrapper
% In a file in your working folder, create a wrapper to the plot function that plots a red line. The redplot function accepts a variable-length input argument list and returns a variable-length output argument list. It sets the line color to red, and forwards other input values to the plot function. This function wrapper enables you to pass redplot the same inputs as plot and not specify that the line color is red.

type redplot.m

% Use redplot to create a line plot.

x = 0:pi/100:2*pi;
y = sin(x);
redplot(x,y)

% Call redplot again, and specify input and output arguments to forward to the plot function.

h = redplot(x,y,'Marker','o','MarkerEdgeColor','green'); 

% Copyright 2012 The MathWorks, Inc.