|MATLAB Release Notes|
Programming and Data Types Features
MATLAB 6.5 adds the following programming and data types features and enhancements:
JIT Accelerator with MATLAB
MATLAB 6.5 includes significant changes in the way MATLAB processes M-file functions and scripts. These changes affect the performance of MATLAB and can give you a substantial performance increase over earlier MATLAB versions for many MATLAB applications.
Speeding up the execution of programs written in MATLAB is an ongoing MathWorks endeavor that will be delivered over a number of product releases. The documentation on Performance Acceleration explains how to best make use of the JIT Accelerator, how to use the MATLAB Profiler to optimize your performance, and includes several sample programs to illustrate how you can make your M-file programs run faster.
Regular Expression Support
MATLAB now supports searching and replacing characters using regular expressions. The following new functions support this capability. For more information, see Regular Expressions in the MATLAB documentation.
||Match regular expression.
||Match regular expressions, ignoring case.
||Replace string using regular expression.
MATLAB 6.5 added new functions for working with error generation, regular expressions, sorted sets, integer conversion, and for performing file operations.
||Set or get attributes of file or directory
||Convert to signed 64-bit integer
||Determine if arrays are numerically equal, treating NaNs as equal
||Determine if set elements are in sorted order
||Return last error message and related information
||Move file or directory
||Order fields of a structure array
||Call Perl script using appropriate operating system executable
||Convert to unsigned 64-bit integer
||Open file in appropriate application (Windows only)
||Parse XML document and return Document Object Model node
||Serialize XML Document Object Model node
||Transform XML document using XSLT engine
Cell to Matrix Conversion Functions
The following functions, previously belonging to the Neural Network Toolbox, are now core MATLAB functions.
||Combine a cell array of matrices into one matrix
||Break matrix up into a cell array of matrices
New Warning and Error Handling Features
These features include:
Formatted Error and Warning Strings. Prior to MATLAB 6.5, the
warning functions only accepted a simple string as an input argument, as shown here for
In MATLAB 6.5,
warning now accept a format string and one or more parameters, using a syntax similar to the MATLAB
sprintf function. The syntax for
error is shown here. Use the same syntax for
Examples for using this syntax with
Message Identifiers. A message identifier is a tag that you attach to an error or warning statement that makes that error or warning uniquely recognizable by MATLAB. You can use message identifiers with warnings to control any selected subset of the warnings in your programs, or with error reporting to better identify the source of an error.
Some examples of message identifiers are
Message identifiers are used in warning control (see next section) and also to enable the
lasterror functions to better identify the source of an error.
See Using Message Identifiers with lasterr in the MATLAB documentation.
Warning Control Features. In this release, MATLAB gives you the ability to control what happens when a warning is encountered during M-file program execution. New options available in this release include
Depending on how you set up your warning controls, you can have these actions affect all warnings in your code, specific warnings that you select, or just the most recently invoked warning. See the section Warning Control in the MATLAB documentation for more information on this feature.
Also read the section, Warning Control Upgrade Issues in these Release Notes to see how your existing programs might be affected by this change.
Dynamic Field Names for Structures
You can now reference structures using field names that are computed at run-time using the new dynamic field names feature in MATLAB. The dot-parentheses syntax shown below tells MATLAB to interpret
expression as a dynamic field name:
This added capability now completes the following table by providing full dynamic access to all data types.
||Static (compile time)
See Dynamic Field Names in the MATLAB documentation for more information on this feature.
getfield and setfield Deprecated. Although the following two expressions are functionally equivalent, the first (using dynamic field names) offers improved execution speed and code readability. Compare the following for readability:
Since dynamic field names improve on the
setfield functions, these two functions will eventually be removed from the MATLAB language. As of this release,
setfield generate a warning message encouraging you to use dynamic field names instead.
New Logical AND and OR Operators for Short-Circuiting
Prior to this release, the MATLAB
OR) operators served two purposes: that of a logical operator and also an array operator. These two roles at times conflicted, resulting in technically correct, yet possibly confusing evaluations.
MATLAB 6.5 introduces two additional
OR operators: && and ||. Use these new operators to evaluate a compound logical expression, especially when short-circuiting is required. Use the & and | operators for element-wise operations on arrays.
See Short-circuit Operators in the MATLAB documentation for a discussion on short-circuiting with
New Output from ismember
ismember function now returns an optional, second output indicating the indices at which members of a set are located. The syntax is
When you use this syntax,
ismember returns index vector
loc containing the highest index in
S for each element in
A that is a member of
S. For those elements of
A that do not occur in
New true and false Functions
MATLAB has two new functions for logical operations:
true is shorthand for
logical(0). Both functions accept input arguments that enable you to build n-dimensional arrays of logical
This example builds a 3-by-5 array of type
true(n) is equivalent to
true(n) is easier to use and will improve the readability of your program. Type
help true or
help false for more information.
Interrupting try-catch in a Loop
catch statements no longer catch Ctl+C interrupts. Prior to this release, pressing Ctl+C while a
try block was executing would result in a jump to the corresponding
catch block. In MATLAB 6.5, a Ctl+C aborts execution and returns control to the Command Window, regardless of what code is executing.
For example, in MATLAB 6.5, you can use Ctl+C to interrupt the loop shown here. You could not interrupt this loop in earlier MATLAB versions:
Changes to copyfile and mkdir
mkdir functions have changed since the previous release.
Changes to copyfile. The
writable argument has been superseded by the
f argument, although
writable is still allowed for this release. The function now also copies directories. It replaces the destination files or directories of the same name as the source files or directories without a warning. (In previous versions, there was a warning in that event.) If the destination files or directories are read-only and the
writable) argument is not used,
copyfile will fail.
Change to mkdir Return Status.
mkdir no longer returns
2 if the directory already exists, but instead displays a warning. It also has an enhanced return format.
mfilename Returns Path and Class Information
You can now request more information from the
mfilename('fullpath')-- Returns the full path and name of the M-file in which the call occurs, not including the filename extension.
mfilename('class')-- In a method, returns the class of the method, not including the leading
@sign. If called from a non-method, it yields the empty string.
Support for the 64-Bit Integers int64 and uint64
MATLAB now supports signed and unsigned 64-bit integers. Use the
uint64 functions to convert a number to a signed or unsigned 64-bit integer.
64-Bit File Handling
MATLAB low-level file handling functions (
ftell, etc.) now support 64-bit file offsets. This enables you to perform low-level I/O operations on files greater than 2 GB in size. (The limit in previous versions of MATLAB was
2^31-1 bytes, or 2 GB.)
64-bit support is available on the following platforms:
64-bit support is not available on the following platforms, due to limitations imposed by their respective operating systems:
On the IBM-AIX platform, 64-bit file I/O is supported for reading only. You can write only up to 2 GB.
MATLAB Audio Enhancements
New audiodevinfo Function. On Windows 32-bit machines,
audiodevinfo returns information about installed audio devices.
UNIX Platform Support for audiorecorder and audioplayer..
audiorecorder are now available on UNIX platforms running Java Runtime Environment 1.3 or higher.
Enhancements to audiorecorder and audioplayer.
audiorecorder can now take the audio device ID as input. You can obtain the device ID from
audioplayer can now take an
audiorecorder as an input.
Support for 24-bit Recording and Playback. On 32-bit Windows machines with an installed 24-bit audio device,
audioplayer now support 24-bit recording and playback, respectively.
Improvement to wavread and wavwrite.
wavwrite now support reading and writing 24- and 32-bit
Workspace Browser Support. Right-clicking on an audio object in the Workspace Browser now displays a context menu with player/recorder controls.
New MATLAB Timer Object
MATLAB includes a timer object that you can use to schedule the execution of MATLAB commands. To use a timer, you must perform these steps:
|Mathematics Features||Programming Tips Documentation|