User`s guide

R2006b
21-24
Compatibility Considerations
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.
unique Function Returns First and Last Indices
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
save Compression and Unicode Options Removed
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: