Release 11 New Features      

Upgrading From MATLAB 5.2 to MATLAB 5.3

This section describes differences between Release 11 and Release 10 that may require code changes to your Release 10 code.

Language Issues

pcode

Prior to MATLAB 5.3, by default pcode put all its .p files, including methods and private functions, in the current directory.

That approach resulted in losing the scope directories (private and class directories) for the function and had the potential to have a method from one directory overwrite the method from another directory.

In MATLAB 5.3, by default pcode puts its .p files for methods and functions in a corresponding class or private directory (created in the current directory if those directories don't already exist).

If you have any pre-5.3 code that relies on the .p file being in the current directory, and you generate new P-code for the method, the .p file will not be where the pre-5.3 code expected it.

Date Functions Need pivotyear Parameter

With MATLAB 5.3, the date functions datenum, datestr, and datevec include a new calling sequence that allows a pivot year specification to override the default. For example, here's the new calling sequence for datevec:

This new call uses the pivot year instead of the current year minus 50 years.

Whether you update your applications that use these date functions depends on the nature of your data and the timeframe when you plan to use the application:

Sparse scalar Expansion

A(:,:) = scalar was incorrectly producing the result A = scalar when it should have been changing all the elements of A to the scalar value (which is what A(1:end,1:end) = scalar does).

getfield Must Use a 1-by-1 Structure

In MATLAB 5.3, the getfield function produces an error message if you use other than a 1-by-1 structure. In MATLAB 5.2, the commands

successfully returned the two element vector

but in MATLAB 5.3, the same code would lead to getfield returning an error message.

Syntax Change for dlmread

The dlmread syntax has changed. You should no longer use the range argument together with the row and column offsets as you could in previous versions of MATLAB (the row and column offsets actually were not used in pre-5.3 MATLAB, if you specified a range argument). Using this calling sequence now produces a warning message:

To use the range argument, use this new calling sequence:

Behavior of linspace and logspace Now the Same as with MATLAB 5.1

In MATLAB 5.3, linspace and logspace now handle NANs, Infs, and complex vectors in the same manner as they did for MATLAB 5.1 and earlier versions. This eliminates an inconsistency in how linspace and logspace handled NANs, Infs, and complex vectors in MATLAB 5.2, as compared to previous MATLAB releases.

Name Changes

These MATLAB functions have new names and calling sequences to support new functionality.

Old Function Name
New Function Name
fmin
fminbnd
fmins
fminsearch
nnls
lsgnonneg

Note that if you have older M-files that use the old names and calling sequences, these calls will generally continue to work. However, the older functions may be removed from MATLAB in future releases, so it is a good idea to revise your code now to use the new names and calling sequences.

Method Search Order Changed

MATLAB now calls converter methods on the path before calling a constructor. Prior to 5.3, MATLAB called constructors before calling methods on the path.

One visible effect of this is that in the case where

exist, MATLAB calls @double/ss.m instead of @ss/ss.m (i.e., the previously shadowed converter functions become visible).

Change to Subscripting for Objects

In MATLAB 5.3, subscripting syntax is dispatched differently from how it was dispatched in previous releases. Within a method, the syntaxes

now use the built-in subsref or subsasgn method if the type of a doesn't match the class directory and no overloaded subsref is defined for the object a. This change only affects child objects within parent methods.

Prior to 5.3, use of the subsref or subsasgn syntax called the parent's subsref method recursively for a child object. Now the syntax uses the built-in method.

For example, for the following

when no subsref existed for @child

used to call the parent's subsref method inside @parent/get.m. MATLAB now uses the built-in method.

Within parent methods where you want the parent's subsref to be used, call the parent's subsref directly (using the function syntax).

Use clear classes to Clear the Class Definition Table

To clear the class definition table so that MATLAB picks up changes in an object's field definition, use

In previous releases, using

would often clear the class definition table, but not always in the proper manner. Replace clear all with clear classes when you want to clear the class definition table safely.

Changes to legend

MATLAB 5.3 enhances legend to:

To support these enhancements, MATLAB 5.3 treats the legend text as one text object, grouping all the text together. So, if your pre-5.3 code manipulates individual handles within a legend, to specify properties such as font size or font color, that code will probably no longer work in MATLAB 5.3.



[ Previous | Next ]