varargout

Syntax

Description

varargout is an output variable in a
function definition statement that enables the function to return any number of
output arguments. Specify varargout using lowercase characters,
and include it as the last output argument after any explicitly declared
outputs.

When the function executes, varargout is a
1-by-N cell array, where N is the number
of outputs requested after the explicitly declared outputs.

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.