User`s guide
R2007a
20-26
Programming
New Functions
New Functions in this release are
Function Description
assert Generates an error when a specified condition is violated. Displays
either the default error message or one that you have written.
ismac Returns true if you are currently running one of the Mac OS X
versions of MATLAB.
verLessThan Compares the specified version number and toolbox name with
the version of that same toolbox that is currently running. Use
verLessThan in your functions when you want to write code that
can run across multiple versions of MATLAB.
Parse Inputs with Consistently Implemented Mechanism
The new inputParser class provides a consistent mechanism for parsing and validating
input arguments in the M-file functions you write. Using inputParser methods in the
body of your function, you build a schema that represents each valid input argument to
the function. In the schema, you can specify whether arguments are required or optional,
and if they are to be passed as single values or as parameter-value pairs. The schema
also provides a means of validating each incoming argument. The properties of the
inputParser class give you additional information about arguments that are passed to
the function.
For more information, see Parse Function Inputs in the MATLAB Programming
documentation.
textscan Returns Like Values in Same Cell Array
In previous versions of MATLAB, the textscan function always returned each output
value in a separate cell array, even if those values were of the same data type. In this
release, if you call textscan with the new CollectOutput switch, MATLAB returns
all consecutive data that is of the same type in the same cell array. This can save you the