| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
New features and changes introduced in this version are:
With MATLAB R2006b, you can save data items that are over 2 gigabytes in size. This capability is implemented in MATLAB using a new HDF5-based format for MAT-files.
To save to a MAT-file in this format, specify the new -v7.3 option with the save function:
save -v7.3 myfile v1 v2
Note MATLAB Version 7.3 does not write MAT-files in HDF5 format by default in this release; you must explicitly specify the -v7.3 switch. |
In this release,
The default MAT-file format employed by save is the standard MAT-file format used in the R14, R14SP, and R2006a releases. You can explicitly specify this format with the command save -v7.
To write an HDF5-based MAT-file, you must use save -v7.3.
HDF5-based MAT-files are not compressed.
In a future release,
The default MAT-file format will be the HDF5-based format. You can explicitly specify the HDF5-based format with the command save -v7.3.
To write the standard MAT-file format, you must use save -v7.
As of release R2008a, HDF5-based MAT files are compressed.
Here is a summary of the version options that you can use with save:
| save Option | Description | Available In Versions | Is the Default In Versions |
|---|---|---|---|
| save -v4 | Save to a MAT-file you can open in MATLAB version 4 | V5 and later | V4, V5 |
| save -v6 | Save to a MAT-file you can open in MATLAB versions 5 or 6 | V7 and later | V6 |
| save -v7 | Save to a MAT-file you can open in MATLAB version 7 | V7.3 and later | V7.3 |
| save -v7.3 | Save to a MAT-file that supports data items ≥2 GB | V7.3 and later | post V7.3 |
If you are running MATLAB on a 64-bit computer system and you attempt to save a variable that is too large for a version 7 (or earlier) MAT-file, that is, you save without using the -v7.3 option, MATLAB skips that variable during the save operation and issues a warning message to that effect.
If you are running MATLAB on a 32-bit computer system and attempt to load a variable from a -v7.3 MAT-file that is too large to fit in 32–bit address space, MATLAB skips that variable and issues a warning message to that effect.
The Import Wizard now includes an automated M-code generation option. Click the Generate M-code button located in the lower right of the Import Wizard window and MATLAB generates an M-file that you can use to import additional files that are similar in type to the file you are currently importing. This simplifies the process of importing multiple files into MATLAB.
The new (?@cmd) operator specifies a MATLAB command that regexp or regexp is to run while parsing the overall match expression. Unlike the other dynamic expressions in MATLAB, this operator does not alter the contents of the expression it is used in. Instead, you can use this functionality to get MATLAB to report just what steps it's taking as it parses the contents of one of your regular expressions. This can be helpful in debugging regular expressions, for example.
Two new reserved keywords have been added to the MATLAB language in this release:
parfor – designates a for loop in the Distributing Computing Toolbox
classdef – signals the beginning of a MATLAB class definition
The iskeyword function returns true for each of these functions, thus identifying them as reserved keywords in MATLAB:
MATLAB keywords are reserved for use internal to MATLAB, and should not be used in your own program code as identifiers or function names. If your code uses either of these two new keywords in this manner, you should modify your code and use words that are not reserved.
The visual output of the information returned by whos looks slightly different in R2006b than in previous releases. Changes are as follows:
There is a new column in the output called Attributes that identifies values that are sparse, complex, global, or persistent.
The words "array" and "object" have been dropped from items under the Class heading. Items formerly listed as double array or timer object , for example, are now displayed as double, and timer.
MATLAB no longer includes summary information showing the "Grand total" of elements and bytes at the bottom of the whos output display.
There is an additional field in the structure returned by whos. This new field is 'persistent' and is set to logical 1 for those variables that are persistent, or logical 0 otherwise.
Here is an example of the information displayed by whos in MATLAB 7.3:
whos Name Size Bytes Class Attributes vCell 5x7 2380 cell vComplex 6x2 192 double complex vDouble 6x5x9 2160 double vFuncHdl 1x1 16 function_handle vGlobal 0x0 0 double global vObject 1x1 248 timer vPersist 0x0 0 double persistent vSparse 15x15 244 double sparse vStruct 1x3 804 struct
If any of your programs depend on the displayed output of whos, specifically in relation to the changes listed above, you might have to modify your program code. Also, if your code relies on a specific number of fields for the output structure, you should be aware that this release adds a new field: persistent.
Using the new first option with the unique function returns a vector with elements that represent the lowest indices of unique elements in the input vector.
Given the following vector A
A = [16 7 5 41 2 16 8 2 6 3 16 6 2 5 2 5];
Get a sorted vector of the unique elements of A:
v = unique(A)
v =
2 3 5 6 7 8 16 41
Use the first and last options to get indices of the first and last elements in A that make up the sorted vector v:
[v, m1] = unique(A, 'first');
m1
m1 =
5 10 3 9 2 7 1 4
[v, m2] = unique(A, 'last');
m2
m2 =
15 10 16 12 2 7 11 4
In MATLAB Versions 7.0 through 7.2, you could use the switches –compress, –nocompress, –unicode, and –nounicode with the save function to enable or disable compression and Unicode character encoding in the MAT-file being generated. In MATLAB Version 7.3, the save function no longer supports these switches. Instead, save now creates a MAT-file with compression and Unicode character encoding by default, or with the following command:
save -v7 filenameYou can still save to a MAT-file without using compression or Unicode encoding. In fact, you will have to do this in order to create MAT-files that you can load into a MATLAB Version 6 or earlier. To save to a MAT-file without compression or Unicode encoding, type
save -v6 filenameTo disable compression and Unicode encoding for all save operations in a MATLAB session, open the MATLAB Preferences dialog, select General and then MAT-Files, and then click the button labelled Ensure backward compatibility (-v6).
If you have code that uses any of these option switches with the save function, you will need to modify that code to use the –v6 option instead.
To accommodate future changes in the MATLAB error handling capabilities, MathWorks has added a new restriction to the single-line syntax of the try-catch block. In this release, the following syntax operates as it did in previous releases, but now it also generates the following warning message:
try try_statements, catch catch_statements, end Warning: This try-catch syntax will continue to work in R2006b, but may be illegal or may mean something different in future releases of MATLAB.
To make this single-line try-catch work without warning in R2006b, you must insert a separator character (comma, semicolon, or newline) immediately after the word catch
try try_statements, catch, catch_statements, end
As with previous releases, the recommended syntax for a try-catch block is as follows:
try try_statements catch catch_statements end
Your M-file programs may generate this warning if correct syntax for try and catch is not used.
The following warning has been removed from MATLAB in release R2006b:
"Function call foo invokes /somewhere/on/the/path/foo.m, however, function /somewhere/ahead/on/the/path/FOO.m that differs only in case precedes it on the path."
In previous versions of MATLAB, this warning message was triggered when you called a function such as foo, and all of the following were true:
There was more than one MATLAB file of this name on the MATLAB path
The names of these files differed only in letter case, and
A MATLAB file of this name but with different case (e.g., FOO.m) preceded a file of matching case (e.g., foo.m) on the path
Earlier versions of MATLAB displayed this warning for the purpose of helping users cope with newly-introduced case sensitive dispatching changes. The warning is being removed at this time under the assumption that users are now sufficiently well-acquainted with the way MATLAB handles case sensitivity in function calls.
The dispatching behavior regarding to the case sensitivity is NOT changed with the removal of this warning message. If both an exact match and inexact match are present on the path, the exact match is always the one to be invoked.
Commands such as fprintf(0, ...) and fwrite(0, ...), in which the file identifier is zero (the same as stdin) now result in an error being thrown. In previous releases, MATLAB did not throw an error in response to these commands, even though printing or writing to stdin is clearly not a valid option.
If any of your programs use lower-level MATLAB file I/O functions that send output to stdin, because these functions no longer ignore this type of operation, your code will now generate an error. You should modify your program code to use a file identifier other than zero.
In the R14 and R14 service pack releases of MATLAB, assigning a nonscalar structure array field to a single variable incorrectly resulted in an error. For example, in the following code, you should be able to assign S.A to one, two, three, or four output variables. However, if you assign to just a single variable, MATLAB throws an error:
% Create a 1-by-4 structure array S with field A.
S(1).A = 1; S(2).A = 2; S(3).A = 3; S(4).A = 4;
% Assigning S(1).A and S(2).A works as expected.
[x y] = S.A
x =
1
y =
2
% Assigning only S(1).A should work, but does not.
x = S.A;
??? Illegal right hand side in assignment. Too many elements.This has been fixed in MATLAB 7.3.
If any of your programs rely on this error being thrown, you will need to modify those programs.
As of Release 14, the function definition line in a function M-file no longer requires commas separating output variables. This now makes the function definition syntax the same as the syntax used when calling an M-file function:
function [A B C] = myfun(x, y)
This new syntax is not valid in MATLAB versions earlier than Release 14. When writing an M-file that you expect to run on versions both earlier and later than R14, be sure to separate any output variables in the function definition line with commas:
function [A, B, C] = myfun(x, y)
In this release, MATLAB offers improved performance in the following areas:
Improved performance on 64-bit Windows XP and Linux platforms. This is independent of the size of data set in use.
Faster scalar indexing into cell arrays.
Faster assignment of cell array data to variables.
![]() | Data Analysis, MATLAB Version 7.3 (R2006b) | Graphics and 3-D Visualization, MATLAB Version 7.3 (R2006b) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |