MATLAB Version 7.9
MATLAB® Release Notes
How to Contact MathWorks
Web
Newsgroup
www.mathworks.com/contact_TS.html Technical Support
www.mathworks.com
comp.soft-sys.matlab
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Product enhancement suggestions
Bug reports
Documentation error reports
Order status, license renewals, passcodes
Sales, pricing, and general information
508-647-7000 (Phone)
508-647-7001 (Fax)
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site.
MATLAB® Release Notes
© COPYRIGHT 2004–2010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or
reproduced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation
by, for, or through the federal government of the United States. By accepting delivery of the Program
or Documentation, the government hereby agrees that this software or documentation qualifies as
commercial computer software or commercial computer software documentation as such terms are used
or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and
conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern
the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government)
and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the
government’s needs or is inconsistent in any respect with federal procurement law, the government agrees
to return the Program and Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand
names may be trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see
www.mathworks.com/patents for more information.
Contents
MATLAB Release Notes
Summary by Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is in the Release Notes . . . . . . . . . . . . . . . . . . . . . . . .
1
2
3
Version 7.11 (R2010b) MATLAB Software
1
Desktop Tools and Development Environment,
MATLAB Version 7.11 (R2010b) . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing and Debugging MATLAB Code . . . . . . . . . . . . . . . .
7
7
9
10
11
Mathematics, MATLAB Version 7.11 (R2010b) . . . . . . . .
64-Bit Integer Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Utility Functions: isrow, iscolumn, ismatrix . . . . . . .
Output Option for Point Distances in
DelaunayTri/nearestNeighbor Method . . . . . . . . . . . . . .
Changes to convhull and delaunay Functions . . . . . . . . . . .
Performance Enhancements . . . . . . . . . . . . . . . . . . . . . . . . .
Functions Being Removed . . . . . . . . . . . . . . . . . . . . . . . . . .
optimset Errors for Optimization Toolbox Options . . . . . . .
atan Warning Being Removed . . . . . . . . . . . . . . . . . . . . . . .
14
14
14
Data Analysis, MATLAB Version 7.11 (R2010b) . . . . . . .
Arrays of Time Series Objects Supported . . . . . . . . . . . . . .
17
17
Programming, MATLAB Version 7.11 (R2010b) . . . . . . .
arrayfun Accepts Array of Objects . . . . . . . . . . . . . . . . . . . .
Comparing Object Arrays that Contain NaNs . . . . . . . . . .
20
20
20
14
15
15
15
16
16
iii
Functions isa and islogical Now Consistent for Objects . . .
New Enumeration Classes . . . . . . . . . . . . . . . . . . . . . . . . . .
New Functionality for Writing Video Files . . . . . . . . . . . . .
mmreader Renamed VideoReader . . . . . . . . . . . . . . . . . . . .
New HDF4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New HDF5 Low-Level Functions . . . . . . . . . . . . . . . . . . . . .
New netCDF Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Upgrades to Scientific File Format Libraries . . . . . . . . . . .
New Examples in Command Line Help . . . . . . . . . . . . . . . .
imread and imwrite Can Now Handle N-channel J2C JPEG
2000 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
csvread and csvwrite Will Not Be Removed . . . . . . . . . . . .
Functions and Function Elements Being Removed . . . . . .
MATLAB Did Not Pass struct to loadobj When Property
Was Deleted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graphics and 3-D Visualization, MATLAB Version 7.11
(R2010b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Print –dmfile and printdmfile Issue Deprecation
Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The saveas ’mmat’ option Issues a Deprecation Warning . .
The movie Function is No Longer a Built-in Function . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.11 (R2010b) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Function Elements Being Removed . . . . . .
External Interfaces/API, MATLAB Version 7.11
(R2010b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
-largeArrayDims Option to MEX Will Become Default in
Next Release of MATLAB . . . . . . . . . . . . . . . . . . . . . . . . .
MEX Function -argcheck Option Removed . . . . . . . . . . . . .
MEX Function -inline Option Removed . . . . . . . . . . . . . . . .
New Support for Features in Microsoft .NET Framework . .
New COM Data Type Support . . . . . . . . . . . . . . . . . . . . . . .
iv
Contents
21
21
21
22
22
22
23
24
24
24
25
25
26
28
28
28
28
29
29
31
31
32
33
34
34
34
Version 7.10 (R2010a) MATLAB Software
2
Desktop Tools and Development Environment,
MATLAB Version 7.10 (R2010a) . . . . . . . . . . . . . . . . . . .
Desktop New Features Video for R2010a . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing and Debugging MATLAB Code . . . . . . . . . . . . . . . .
37
37
37
37
39
42
45
Mathematics, MATLAB Version 7.10 (R2010a) . . . . . . . .
New Multithreading Capability . . . . . . . . . . . . . . . . . . . . . .
Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . .
Changes To qr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Change in Indexing for Sparse Matrix Input . . . . . . . . . . .
Improved Error Checking for Sparse Functions . . . . . . . . .
Computational Geometry Functions Being Changed . . . . .
Computational Geometry Functions Being Removed . . . . .
lsqnonneg No Longer Uses Optional Starting Point
Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function erfcore Removed . . . . . . . . . . . . . . . . . . . . . . . . . .
Integer Warning Messages Removed . . . . . . . . . . . . . . . . . .
Function intwarning Being Removed . . . . . . . . . . . . . . . . .
atan Warning Being Removed . . . . . . . . . . . . . . . . . . . . . . .
nextpow2 Returns Output the Same Size As Input . . . . . .
Math Libraries Not Available to Build MEX-Files with
Compaq Visual Fortran . . . . . . . . . . . . . . . . . . . . . . . . . .
46
46
46
47
47
47
48
48
Data Analysis, MATLAB Version 7.10 (R2010a) . . . . . . .
Operations on Timeseries Objects Sometimes Warn About
the isTimeFirst Property . . . . . . . . . . . . . . . . . . . . . . . . .
Time Series Time Vectors Can Now Contain Duplicate
Sample Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
Programming, MATLAB Version 7.10 (R2010a) . . . . . . .
Subscripting Into Function Return Values . . . . . . . . . . . . .
New Constructor for Map Containers . . . . . . . . . . . . . . . . .
Function Handle Access to Private and Protected
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Listing Video File Formats Supported by mmreader . . . . .
54
54
55
48
49
49
49
50
50
50
52
53
55
55
v
unzip Preserves Write Attribute of Files . . . . . . . . . . . . . . .
New Package Provides Access to low-level CDF API
Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Upgrades to Scientific File Format Libraries . . . . . . . . . . .
Tiff Class Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . .
MATLAB Adds Support for Creating JPEG 2000 Files . . .
Sealed No Longer Listed as meta.property Class
Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Function Elements Being Removed . . . . . .
Graphics and 3-D Visualization, MATLAB Version 7.10
(R2010a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plot Selector Supports Additional Toolboxes . . . . . . . . . . . .
External Interfaces/API, MATLAB Version 7.10
(R2010a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
Changes to Libraries on Linux with Debian Systems . . . . .
Math Libraries Not Available to Build MEX-Files with
Compaq Visual Fortran . . . . . . . . . . . . . . . . . . . . . . . . . .
Cannot Create MEX-Files with DLL File Extension . . . . .
-largeArrayDims Option to MEX Will Become Default in
Next Release of MATLAB . . . . . . . . . . . . . . . . . . . . . . . . .
56
56
56
56
57
57
57
61
61
62
62
64
64
64
65
Version 7.9.1 (R2009bSP1) MATLAB Software
3
Version 7.9 (R2009b) MATLAB Software
4
Desktop Tools and Development Environment,
MATLAB Version 7.9 (R2009b) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace and Variable Editor . . . . . . . . . . . . . . . . . . . . . .
vi
Contents
71
71
72
74
79
Managing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Exchange Desktop Tool — Find and Get Files Created
by Other Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing and Debugging MATLAB Code Files . . . . . . . . . . .
Publishing MATLAB Code Files to PDF Output Format . .
Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
79
Mathematics, MATLAB Version 7.9 (R2009b) . . . . . . . . .
Computational Geometry Functions Being Changed . . . . .
Computational Geometry Functions Being Removed . . . . .
New Sparse Matrix Functionality In qr and mldivide
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support for Large-Sized Dimensions In fft . . . . . . . . . . . . .
Performance Improvement For Large Data Sets . . . . . . . .
erfcore Being Removed . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Multithreading Capability . . . . . . . . . . . . . . . . . . . . . .
New Test Matrices in gallery Function . . . . . . . . . . . . . . . .
86
86
86
Data Analysis, MATLAB Version 7.9 (R2009b) . . . . . . . .
Improved Plot Selector Makes Graphic Data Exploration
Easier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
89
Programming, MATLAB Version 7.9 (R2009b) . . . . . . . .
Ignore Selected Arguments on Function Calls . . . . . . . . . .
Internal Packages Make Reserved Functions Easy to
Identify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of lasterror, lasterr, rethrow(errStruct) Not
Recommended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of maxNumCompThreads No Longer Recommended . .
Excel Worksheet Selection in the Import Wizard . . . . . . . .
Motion JPEG 2000 Files Supported by mmreader . . . . . . .
Minimum Sample Rate for audioplayer . . . . . . . . . . . . . . . .
Documentation Changes: File I/O and Data Import and
Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Array Property Indexing . . . . . . . . . . . . . . . . . . . . . .
Equality of Objects Using isequal Now Ignores Numeric
Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Class Defining Private/Abstract Property Now Errors . . . .
Subclasses of Built-in Classes and numel . . . . . . . . . . . . . .
Array Expansion with Indexed Assignment . . . . . . . . . . . .
New Tiff Object Enables Writing of Tiled Data and Broader
Metadata Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ambiguity Error Now Reported . . . . . . . . . . . . . . . . . . . . . .
90
90
82
83
84
84
87
87
87
87
88
88
89
91
92
93
93
93
94
94
94
95
95
95
95
96
96
vii
Graphics and 3-D Visualization, MATLAB Version 7.9
(R2009b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhanced Plot Selector Simplifies Data Display . . . . . . . .
Certain Print Options and Devices Now Warn When
Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The view Function No Longer Supports 4-by-4
Transformation Matrices as Input . . . . . . . . . . . . . . . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.9 (R2009b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expanded Documentation on Techniques for Programmatic
GUI Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Previous Change to How UI Components Set the Figure
SelectionType Property . . . . . . . . . . . . . . . . . . . . . . . . . .
External Interfaces/API, MATLAB Version 7.9
(R2009b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
Run-Time Libraries Required for Applications Built with
Microsoft® Visual Studio 2008 Compiler . . . . . . . . . . . . .
Changes to Building MEX-Files . . . . . . . . . . . . . . . . . . . . . .
New Features for Interface to Microsoft .NET
Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
98
98
101
102
103
103
103
105
105
106
107
107
Version 7.8 (R2009a) MATLAB Software
5
Desktop Tools and Development Environment,
MATLAB Version 7.8 (R2009a) . . . . . . . . . . . . . . . . . . . .
Desktop New Features Video . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and History . . .
Help and Related Resources . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging MATLAB Code . . . . . . . . . . . . . . . .
Tuning and Managing MATLAB Code Files . . . . . . . . . . . .
Publishing MATLAB Code Files . . . . . . . . . . . . . . . . . . . . .
viii
Contents
111
111
111
111
113
113
114
115
121
121
Mathematics, MATLAB Version 7.8 (R2009a) . . . . . . . . .
Upgrade to Computational Geometry . . . . . . . . . . . . . . . . .
Incomplete Inverse Gamma Function gammaincinv and
Incomplete Inverse Beta Function betaincinv . . . . . . . .
Krylov Subspace Methods bicgstabl and tfqmr . . . . . . . . . .
New Function quad2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes To conv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes To conv2 and convn . . . . . . . . . . . . . . . . . . . . . . . .
nextpow2 Changing to Element-By-Element Calculation in
a Future Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function finite Being Removed . . . . . . . . . . . . . . . . . . . . . .
New Multithreading Capability in MATLAB Functions . .
64-bit Support in LAPACK and BLAS . . . . . . . . . . . . . . . . .
Upgrade to ACML 4.1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
123
123
........
127
Data Analysis, MATLAB Version 7.8 (R2009a)
Programming Fundamentals, MATLAB Version 7.8
(R2009a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Number of Threads Removed from Preferences
Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Timer Objects Saved in New Format . . . . . . . . . . . . . . . . . .
mmreader Supports Linux Platforms . . . . . . . . . . . . . . . . .
Support of Microsoft® Excel 2007 File Formats . . . . . . . . .
Anonymous Functions Support str2func . . . . . . . . . . . . . . .
size and range Implemented for validateattributes . . . . . .
isempty Supported for Map Objects . . . . . . . . . . . . . . . . . . .
Bug Fix for Misinterpreted Variables . . . . . . . . . . . . . . . . .
MATLAB Upgrades Support for HDF5 to Version 1.8.1 . . .
Indirect Calls to Superclass Constructors Now Errors . . . .
Graphics and 3-D Visualization, MATLAB Version 7.8
(R2009a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions Previously Only Available in the Image
Processing Toolbox Now Available in MATLAB . . . . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.8 (R2009a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Programmatic GUI Doc Example . . . . . . . . . . . . . . . .
GUIDE Help Menu Enhanced . . . . . . . . . . . . . . . . . . . . . . .
124
124
124
124
124
125
125
125
125
126
128
128
129
129
129
130
130
130
131
132
132
133
133
134
134
134
ix
External Interfaces/API, MATLAB Version 7.8
(R2009a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Interface to Microsoft .NET Framework . . . . . . . . . . .
Expanded Platform Support Added for MATLAB Serial
Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes To Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
Do Not Use mxFree to Destroy mxArrays . . . . . . . . . . . . . .
Cannot Build MEX-Files Using MATLAB Version 5 API . .
MEX-Files Calling BLAS or LAPACK Functions Must Be
Updated On 64-Bit Platforms . . . . . . . . . . . . . . . . . . . . .
Object .o Files Saved on Macintosh Systems for
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Run-Time Libraries Required for Applications Built with
Microsoft® Visual Studio 2008 Compiler . . . . . . . . . . . . .
New Features for Shared Library Interface . . . . . . . . . . . .
New Java Thread Safety Functions . . . . . . . . . . . . . . . . . . .
Improved Robustness of Web Services Functions . . . . . . . .
135
135
135
136
137
138
138
139
139
139
139
140
Version 7.7 (R2008b) MATLAB Software
6
x
Contents
Desktop Tools and Development Environment,
MATLAB Version 7.7 (R2008b) . . . . . . . . . . . . . . . . . . . .
Desktop New Features Video . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and History . . .
Help and Related Resources . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging MATLAB Code . . . . . . . . . . . . . . . .
Tuning and Managing MATLAB Code Files . . . . . . . . . . . .
Publishing MATLAB Code Files . . . . . . . . . . . . . . . . . . . . .
143
143
143
147
148
151
153
160
164
164
Mathematics, MATLAB Version 7.7 (R2008b) . . . . . . . . .
Upgrade to Random Number Generator . . . . . . . . . . . . . . .
Multipoint Boundary-Value Problems with bvp5c . . . . . . .
Upgrades to lsqnonneg . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Properties Being Removed . . . . . . . . . . . . . .
Upgrade to Intel Math Kernel Libraries . . . . . . . . . . . . . . .
166
166
167
167
167
167
Data Analysis, MATLAB Version 7.7 (R2008b) . . . . . . . .
Specialized Data Tips for the hist Function . . . . . . . . . . . .
Programming Fundamentals, MATLAB Version 7.7
(R2008b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Fast Key Lookup Provided with New Map Data
Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tic and Toc Support Multiple Consecutive Timings . . . . . .
New Options for MException getReport . . . . . . . . . . . . . . .
what Function Returns Package Information . . . . . . . . . . .
addtodate Accepts Hours, Minutes, Seconds,
Milliseconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Querying Options Added to pause . . . . . . . . . . . . . . . . . . . .
File Selection Restriction in Import Wizard . . . . . . . . . . . .
Function Handle Array Warning Is Now An Error . . . . . . .
Two Types of issorted Warnings Are Now Errors . . . . . . . .
Possible Conflict with New Keyword: SPMD . . . . . . . . . . .
Do Not Create MEX-Files with DLL File Extensions . . . . .
isequal Is Now Called Explicitly for Contained Objects . . .
Indexed Assignment with Objects of the Form p(:) = o Now
Consistent with MATLAB Language . . . . . . . . . . . . . . . .
fopen No Longer Supports VAXD, VAXG, and Cray Machine
Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graphics and 3-D Visualization, MATLAB Version 7.7
(R2008b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Certain Printer Formats and Drivers Now Warn When
Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Handle Graphics Not Supported Under -nojvm Startup
Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.7 (R2008b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Undocumented Functions Removed . . . . . . . . . . . . . . . . . . .
Handle Graphics Not Supported Under -nojvm Startup
Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Menu Options to Hide or Show GUIDE Toolbar and
Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GUIDE Status Bar Now Shows Tag Property of Selected
Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Four New Major GUI Examples . . . . . . . . . . . . . . . . . . . . . .
168
168
169
169
170
171
171
172
172
173
174
175
175
176
176
177
177
179
179
181
182
182
183
183
184
184
xi
External Interfaces/API, MATLAB Version 7.7
(R2008b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Do Not Use DLL File Extensions for MEX-Files . . . . . . . . .
MEX-Files Must Be Recompiled When -largeArrayDims
Becomes Default MEX Option . . . . . . . . . . . . . . . . . . . . .
New Compiler Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiler Support to Be Phased Out . . . . . . . . . . . . . . . . . .
Use mxDestroyArray to Release Memory for mxArray . . .
New Function Displays Information about MEX Compiler
Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Functions to Catch Errors in MEX-Files Replace
mexSetTrapFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
“Duplicate dylib” Warning on Macintosh Systems . . . . . . .
Microsoft® Visual Studio "X64 Compilers and Tools"
Required for 64-bit Systems . . . . . . . . . . . . . . . . . . . . . . .
Run-Time Libraries Required for Applications Built with
Microsoft® Visual Studio 2008 Compiler . . . . . . . . . . . . .
Do Not Use get or set Function to Manage Properties of
Java Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
COM Objects Might Display Different Number of Supported
Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
185
185
186
186
186
187
187
188
188
188
189
189
189
Version 7.6 (R2008a) MATLAB Software
7
xii
Contents
Desktop Tools and Development Environment,
MATLAB Version 7.6 (R2008a) . . . . . . . . . . . . . . . . . . . .
Desktop New Features Video . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and History . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Publishing M-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
193
193
193
197
199
200
200
204
204
209
219
Mathematics, MATLAB Version 7.6 (R2008a) . . . . . . . . .
Upgrade to BLAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . .
221
221
Upgrade to LAPACK Library . . . . . . . . . . . . . . . . . . . . . . . .
More Multithreaded Support For Elementwise Math
Functions With Warnings . . . . . . . . . . . . . . . . . . . . . . . .
New Algorithms for ldl, logm, and funm Functions . . . . . .
Functions and Properties Being Removed . . . . . . . . . . . . . .
221
Data Analysis, MATLAB Version 7.6 (R2008a) . . . . . . . .
Data Brushing for Graphs and Linked Variables . . . . . . . .
223
223
Programming, MATLAB Version 7.6 (R2008a) . . . . . . . .
Multithreaded Computations Enabled . . . . . . . . . . . . . . . .
Enhancements to Object-Oriented Programming
Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Packages for Classes and Functions . . . . . . . . . . . . . . . . . .
Clear Variables with Exceptions . . . . . . . . . . . . . . . . . . . . .
Information on the State of Memory . . . . . . . . . . . . . . . . . .
Define Your Own Function Cleanup Tasks . . . . . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extended JIT Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhancements to Image Information and Writing
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compression of -v7.3 MAT-Files . . . . . . . . . . . . . . . . . . . . .
Changes to Programming Documentation . . . . . . . . . . . . . .
229
229
221
221
222
229
230
230
230
231
231
231
231
232
232
Graphics and 3-D Visualization, MATLAB Version 7.6
(R2008a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Figure Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . . . .
“v6” Plotting Option Update — Affected Functions . . . . . .
233
233
233
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.6 (R2008a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New GUI Table Component . . . . . . . . . . . . . . . . . . . . . . . . .
Event Data Input to GUIDE Callbacks . . . . . . . . . . . . . . . .
uigetfile and uiputfile Support of ’.’, ’..’, and ’/’ . . . . . . . . . .
hidegui Function Being Obsoleted . . . . . . . . . . . . . . . . . . . .
Changes to How uicontrols Set Figure SelectionType . . . .
236
236
236
237
237
237
External Interfaces/API, MATLAB Version 7.6
(R2008a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interface to Generic DLLs Supported on 64-bit
Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
240
240
240
xiii
New Version of Perl on Windows Platforms . . . . . . . . . . . .
Rebuild MEX-Files Created on Linux Platforms . . . . . . . .
Use mxDestroyArray to Release Memory for mxArray . . .
Do Not Use get or set Function to Manage Properties of
Java Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New mxArray Functions for Use with MATLAB Class
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mex.bat File Removed from matlabroot\bin\$ARCH . . . .
Run-time Libraries Required for Applications Built with
Microsoft® Visual Studio 2008 Compiler . . . . . . . . . . . . .
Environment Variables Required with Intel Visual Fortran
9.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-largeArrayDims Option to MEX Will Become Default . . .
Changes to Dynamic Data Exchange (DDE)
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
242
242
243
243
244
244
244
245
245
246
Version 7.5 (R2007b) MATLAB Software
8
Desktop Tools and Development Environment,
MATLAB Version 7.5 (R2007b) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and History . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematics, MATLAB Version 7.5 (R2007b) . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
finite Function Deprecated . . . . . . . . . . . . . . . . . . . . . . . . . .
dmperm Function Gives Coarse Decomposition . . . . . . . . .
ldl Function Supports Real Sparse Symmetric Matrices . .
Upgrade to LAPACK Library . . . . . . . . . . . . . . . . . . . . . . . .
Upgrade to BLAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . .
Library for LAPACK and BLAS Symbols Separated . . . . .
Colon Operations on Characters Return Character Type
Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matrix Generating Functions No Longer Accept Complex
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xiv
Contents
249
249
250
253
254
259
267
269
269
269
270
270
270
270
270
271
271
........
273
Programming, MATLAB Version 7.5 (R2007b) . . . . . . . .
Increased Size for Large Arrays . . . . . . . . . . . . . . . . . . . . . .
Documentation for Multiprocessing in MATLAB . . . . . . . .
Setting Number of Threads Programmatically . . . . . . . . . .
New Internal Format for P-code . . . . . . . . . . . . . . . . . . . . . .
New Split String Functionality in regexp . . . . . . . . . . . . . .
Changes Related to Error Handling . . . . . . . . . . . . . . . . . . .
Results From tempname Are More Unique . . . . . . . . . . . . .
MATLAB Includes New Input Argument Validation
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows Current Working Directory Corrected . . . . . . . . .
New Multimedia Functionality . . . . . . . . . . . . . . . . . . . . . .
Compressed AVI Video Files in Windows Vista and
Windows XP x64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mmfileinfo Reads Files on MATLAB Path . . . . . . . . . . . . . .
Changes to imread Support of TIFF Format . . . . . . . . . . . .
Removal of freeserial Function . . . . . . . . . . . . . . . . . . . . . . .
274
274
274
275
275
275
276
279
Data Analysis, MATLAB Version 7.5 (R2007b)
Graphics and 3-D Visualization, MATLAB Version 7.5
(R2007b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datatips Are Now Saved to FIG-Files . . . . . . . . . . . . . . . . .
New Options for Displaying Groups of Lines in Legends . .
Drawnow Update Option Now Updates Uicontrols Only . .
Annotation Textboxes Can Automatically Resize to Fit their
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Property Inspector Now Has Context-Sensitive Help . . . . .
The “v6” Option for Creating Plot Objects is Obsolete . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.5 (R2007b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Editors for Creating Custom Toolbars within
GUIDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Coordinate Readouts in Layout Editor . . . . . . . . . . . . . . . .
Documentation for Making GUIDE GUIs Interact . . . . . . .
Functions Being Removed . . . . . . . . . . . . . . . . . . . . . . . . . .
External Interfaces/API, MATLAB Version 7.5
(R2007b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support for 64-bit mxArrays . . . . . . . . . . . . . . . . . . . . . . . .
Fortran MEX-Files Will Require mwSize and mwIndex . .
279
279
280
281
281
281
282
283
283
283
284
284
286
286
288
288
289
289
290
292
292
293
xv
Changes to the MATLAB Locale Setting . . . . . . . . . . . . . . .
Changes to MEX Error-Handling Functions mexErrMsgTxt
and mexErrMsgIdAndTxt . . . . . . . . . . . . . . . . . . . . . . . .
Rebuild MEX-Files Created with MATLAB Versions Earlier
Than V7 (R14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
Changes to Applications Built with Borland 5.5 or 5.6 C
Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Environment Variable Required for mex with Microsoft
Platform SDK Compiler . . . . . . . . . . . . . . . . . . . . . . . . . .
Environment Variables Required for mex with Intel Visual
Fortran 9.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Handling ActiveX Methods . . . . . . . . . . . . . . . .
Changes to Dynamic Data Exchange (DDE)
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
293
294
294
294
296
296
296
297
297
Version 7.4 (R2007a) MATLAB Software
9
Desktop Tools and Development Environment,
MATLAB Version 7.4 (R2007a) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions—Command Window and History . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematics, MATLAB Version 7.4 (R2007a) . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
More Efficient Matrix Multiplication for Sparse
Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
rand Function Uses the Mersenne Twister Algorithm as
Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Upgrade to BLAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . .
mode of Empty Array Now Returns NaN . . . . . . . . . . . . . .
Change to Syntax for Setting BLAS Library Version on
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xvi
Contents
301
301
306
314
315
317
318
321
321
323
323
323
323
325
325
325
........
326
Programming, MATLAB Version 7.4 (R2007a) . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parse Inputs with Consistently Implemented
Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
textscan Returns Like Values in Same Cell Array . . . . . . .
Numbered Arguments for Formatted String Functions . . .
The dir Function Returns Additional datenum Field . . . . .
Using whos -file on Objects with Overloaded size or class
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mat2str Returns Correct Output for Strings . . . . . . . . . . . .
Warning Generated by try-catch . . . . . . . . . . . . . . . . . . . . .
save -regexp Saves to Correct Filename . . . . . . . . . . . . . . .
Functions Not Callable If in Directory Under Class
Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Improved Performance on Certain Platforms and
Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Technique to Conserve Memory on Windows Vista . . . . . .
ispuma Function Deprecated . . . . . . . . . . . . . . . . . . . . . . . .
327
327
Data Analysis, MATLAB Version 7.4 (R2007a)
Graphics and 3-D Visualization, MATLAB Version 7.4
(R2007a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nudging Annotations with Arrow Keys . . . . . . . . . . . . . . . .
Movies No Longer Play During Loading . . . . . . . . . . . . . . .
Ghostscript Printing Software Upgraded . . . . . . . . . . . . . .
Property Inspector Now Categorizes Graphic Object
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure WindowScrollWheelFcn Property Programs
Scrollwheel Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figure KeyReleaseFcn Property Programs Key Release
Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.4 (R2007a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GUIDE No Longer Copies Callbacks When You Duplicate
Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GUIDE M-File-Defined handles Structure Fields No Longer
Become Permanent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UNIX: File Dialog ’Location’ Property Is Obsolete . . . . . . .
Functions Becoming Obsolete . . . . . . . . . . . . . . . . . . . . . . .
328
328
328
329
330
330
331
332
332
333
333
334
335
335
335
336
336
338
338
339
339
339
340
340
xvii
External Interfaces/API, MATLAB Version 7.4
(R2007a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New File Extensions for MEX-Files . . . . . . . . . . . . . . . . . . .
MEX-Files Built in MATLAB R11 or Earlier Must Be
Rebuilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
New COM Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Handling Microsoft® ActiveX Methods . . . . . . .
342
342
343
343
347
348
Version 7.3 (R2006b) MATLAB Software
10
Desktop Tools and Development Environment,
MATLAB Version 7.3 (R2006b) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematics, MATLAB Version 7.3 (R2006b) . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
max and min Now Use Magnitudes and Phase Angle for
Complex Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Output from lu . . . . . . . . . . . . . . . . . . . . . . . . . .
Upper and Lower Factors for chol and ldl . . . . . . . . . . . . . .
Permutation Vectors with lu, luinc, ldl . . . . . . . . . . . . . . . .
Two-Element Threshold for lu, spparms . . . . . . . . . . . . . . .
Lower Triangular Factors from symbfact . . . . . . . . . . . . . .
Support for New Versions of AMD, COLAMD, CHOLMOD,
UMFPACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sparse Arrays on 64-Bit Systems . . . . . . . . . . . . . . . . . . . . .
FFTW Upgraded to Version 3.1.1 in MATLAB . . . . . . . . . .
Future Obsolete Functions . . . . . . . . . . . . . . . . . . . . . . . . . .
Obsolete Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
max and min No Longer Return Warning Messages for
Inputs with Different Data Types . . . . . . . . . . . . . . . . . .
xviii
Contents
353
353
354
357
358
359
363
365
366
366
367
367
367
367
367
368
368
368
369
370
370
371
Data Analysis, MATLAB Version 7.3 (R2006b) . . . . . . . .
Generate M-File Now Supports Basic Fitting and Data
Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Options for Working with Time Series Objects . . . . . .
372
Programming, MATLAB Version 7.3 (R2006b) . . . . . . . .
Saving to MAT-Files Larger than 2 GB . . . . . . . . . . . . . . . .
Import Wizard Generates Import M-Code . . . . . . . . . . . . . .
New Dynamic Regular Expression Syntax . . . . . . . . . . . . .
New Reserved MATLAB Keywords . . . . . . . . . . . . . . . . . . .
Enhancements to Display Generated by whos . . . . . . . . . .
unique Function Returns First and Last Indices . . . . . . . .
save Compression and Unicode Options Removed . . . . . . .
Warning Generated by try-catch . . . . . . . . . . . . . . . . . . . . .
Case-Sensitivity Warning Removed . . . . . . . . . . . . . . . . . . .
fprintf(0,...) Now Throws an Error . . . . . . . . . . . . . . . . . . . .
Assigning Nonscalar Structure Array Fields to a Single
Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comma Separators Not Required in Function
Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Improved Performance on Certain Platforms and
Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
373
373
375
375
375
376
377
377
378
379
379
Graphics and 3-D Visualization, MATLAB Version 7.3
(R2006b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting Tools Are Now Modular Desktop Components . . .
Version 6 Property Editor Has Been Removed . . . . . . . . . .
New Desktop Printing GUI . . . . . . . . . . . . . . . . . . . . . . . . .
Zoom Mode Now Supports Mouse Scroll Wheel . . . . . . . . .
Data Cursor Text Can Now Be Programmatically
Modified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing Zoom, Pan, and Rotate3D Data Explore
Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Improvements to MATLAB Graphics Documentation . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.3 (R2006b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions Are Now Obsolete . . . . . . . . . . . . . . . . . . . . . . . .
Colored Buttons on Windows XP . . . . . . . . . . . . . . . . . . . . .
Documentation Enhancement . . . . . . . . . . . . . . . . . . . . . . .
372
372
380
381
381
382
382
382
383
383
384
384
385
386
386
386
387
xix
External Interfaces/API, MATLAB Version 7.3
(R2006b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Types for Declaring Size and Index Values . . . . . . . . .
Sparse Arrays on 64-bit Systems . . . . . . . . . . . . . . . . . . . . .
New MAT-File Format Based on HDF5 . . . . . . . . . . . . . . .
-V5 Option to MEX to Be Removed . . . . . . . . . . . . . . . . . . .
Location of mex.bat File Changed . . . . . . . . . . . . . . . . . . . .
Changes to Compiler Support . . . . . . . . . . . . . . . . . . . . . . .
Actxcontrol Command Now Validates ProgID . . . . . . . . . .
388
388
389
390
391
391
391
391
Version 7.2 (R2006a) MATLAB Software
11
Desktop Tools and Development Environment,
MATLAB Version 7.2 (R2006a) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and Command
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Source Control Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xx
Contents
395
395
396
397
398
398
399
406
408
408
Mathematics, MATLAB Version 7.2 (R2006a) . . . . . . . . .
New Library CHOLMOD for Sparse Cholesky
Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Solver for State-Dependent DDEs . . . . . . . . . . . . . . . .
Upgrade to BLAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . .
New Function for Integer Division . . . . . . . . . . . . . . . . . . . .
New Input to gallery Function . . . . . . . . . . . . . . . . . . . . . . .
Improved Algorithm for expm . . . . . . . . . . . . . . . . . . . . . . .
More Efficient condest for Sparse Matrices . . . . . . . . . . . . .
accumarray Accepts Cell Vector Input . . . . . . . . . . . . . . . . .
409
Data Analysis, MATLAB Version 7.2 (R2006a) . . . . . . . .
Data Analysis Collection Revised and Expanded . . . . . . . .
Reference Pages for timeseries and tscollection Objects . . .
411
411
411
409
409
409
410
410
410
410
410
Text Files Can Be Imported In Time Series Tools . . . . . . .
Linux 64 Platform Fully Enabled for Time Series Tools . .
411
411
Programming, MATLAB Version 7.2 (R2006a) . . . . . . . .
Larger Data Sets with 64-Bit Windows XP . . . . . . . . . . . . .
Using avifile and movie2avi on Windows XP 64 . . . . . . . . .
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Environment Variables . . . . . . . . . . . . . . . . . . . . . .
issorted Support for Cell Arrays . . . . . . . . . . . . . . . . . . . . . .
XLS Functions Support More Formats . . . . . . . . . . . . . . . .
Archiving Functions Accept Files on Path and ~/ . . . . . . . .
sendmail No Longer Requires ASCII Messages . . . . . . . . .
MATLAB Warns on Invalid Input to str2func . . . . . . . . . .
Changes to Character Encoding in File I/O . . . . . . . . . . . . .
412
412
412
413
414
414
414
415
415
415
415
Graphics and 3-D Visualization, MATLAB Version 7.2
(R2006a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pasting Cut or Copied Graphic Objects Can Create an
Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inspector Has New Look . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.2 (R2006a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Treatment of & in Menu Label Is Changed . . . . . . . . . . . . .
Major Documentation Revision . . . . . . . . . . . . . . . . . . . . . .
External Interfaces/API, MATLAB Version 7.2
(R2006a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MEX-Files Built with gcc on Linux Must Be Rebuilt . . . . .
MEX-Files in MATLAB for Microsoft Windows x64 . . . . . .
New Microsoft and Intel Compilers Supported . . . . . . . . . .
MWPOINTER Macro for Platform-Independent Fortran
Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compaq Visual Fortran Engine and MAT Options File
Renamed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Options Files Removed for Unsupported Compilers . . . . . .
Obsolete Functions No Longer Documented . . . . . . . . . . . .
Support for Licensed ActiveX Controls . . . . . . . . . . . . . . . .
Support for VT_Date Type . . . . . . . . . . . . . . . . . . . . . . . . . .
Dynamic Linking of External Libraries . . . . . . . . . . . . . . . .
419
419
419
421
421
421
423
423
424
424
425
425
425
426
430
431
431
xxi
Version 7.1 (R14SP3) MATLAB Software
12
Desktop Tools and Development Environment,
MATLAB Version 7.1 (R14SP3) . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and Command
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxii
Contents
435
435
436
439
440
442
443
446
447
Mathematics, MATLAB Version 7.1 (R14SP3) . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modified Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to accumarray . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Imposing Nonnegativity Constraints on Computed ODE
Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mersenne Twister Support in rand . . . . . . . . . . . . . . . . . . .
svd Returns Economy Decomposition . . . . . . . . . . . . . . . . .
New Location for LAPACK Libraries . . . . . . . . . . . . . . . . . .
Documentation on Data Analysis . . . . . . . . . . . . . . . . . . . . .
449
449
450
450
Data Analysis, MATLAB Version 7.1 (R14SP3) . . . . . . . .
Data Analysis Documentation . . . . . . . . . . . . . . . . . . . . . . .
Time-Series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
453
453
453
Programming, MATLAB Version 7.1 (R14SP3) . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modified Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Evaluation Functions for Arrays, Structures, Cells . . . . . .
Using who and whos with Nested Functions . . . . . . . . . . . .
Date and Time Functions Support Milliseconds . . . . . . . . .
Stack Trace Provided for lasterror . . . . . . . . . . . . . . . . . . . .
isfield Function Supports Cell Arrays; Results Might Differ
from Previous Version . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support for Reading EXIF Data from Image Files . . . . . . .
Performance Improvements to the MATLAB JIT/Accelerator
on Macintosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
455
455
456
457
457
457
457
451
451
451
452
452
457
458
459
Specifying fread Precision as Number of Bits . . . . . . . . . . .
Seconds Field Now Truncated; Results Might Differ . . . . .
Built-in Functions No Longer Use .bi; Impacts Output of
which Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Warning About Potential Naming Conflict . . . . . . . . .
459
460
460
461
Graphics and 3-D Visualization, MATLAB Version 7.1
(R14SP3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plot Tools Now Available on Mac Platform . . . . . . . . . . . . .
Documentation for Data Analysis Reorganized . . . . . . . . .
462
462
462
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.1 (R14SP3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plans for Obsolete Functions . . . . . . . . . . . . . . . . . . . . . . . .
463
463
External Interfaces/API, MATLAB Version 7.1
(R14SP3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
mex Switches Now Supported on Microsoft Windows . . . .
New COM Programmatic Identifier . . . . . . . . . . . . . . . . . . .
New File Extension for MEX-Files on Windows Systems . .
New Preferences Directory and MEX Options . . . . . . . . . .
Compiler Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Import Libraries Moved . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MEX Perl Script Moved . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linking to System Libraries . . . . . . . . . . . . . . . . . . . . . . . . .
COM Automation Server Now Displays Figure . . . . . . . . .
465
465
466
466
468
469
469
470
470
470
Version 7.0.4 (R14SP2) MATLAB Software
13
Desktop Tools and Development Environment,
MATLAB Version 7.0.4 (R14SP2) . . . . . . . . . . . . . . . . . .
Installation Folder with Spaces . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and History . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
473
473
474
474
475
475
476
477
xxiii
Source Control Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
478
478
Mathematics, MATLAB Version 7.0.4 (R14SP2) . . . . . . .
New Vendor BLAS Used for Linear Algebra in MATLAB . .
max and min on Complex Integers Not Supported . . . . . . .
480
480
480
Programming, MATLAB Version 7.0.4 (R14SP2) . . . . . .
Memory-Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
textscan Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xlsread Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xlsread Imported Date Format Changes . . . . . . . . . . . . . . .
format Options Added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nonscalar Arrays of Function Handles to Become
Invalid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assigning Nonstructure Variables As Structures Displays
Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Declaration Compatibililty with Pre-R14
M-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
481
481
482
482
482
482
483
483
485
Graphics and 3-D Visualization, MATLAB Version 7.0.4
(R14SP2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
imwrite Now Supports GIF Export . . . . . . . . . . . . . . . . . . .
Compatibility Considerations . . . . . . . . . . . . . . . . . . . . . . . .
487
487
487
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.0.4 (R14SP2) . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Callbacks Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . .
488
488
External Interfaces/API, MATLAB Version 7.0.4
(R14SP2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New File Archiving Functions and Functionality . . . . . . . .
489
489
Version 7.0.1 (R14SP1) MATLAB Software
14
Desktop Tools and Development Environment,
MATLAB Version 7.0.1 (R14SP1) . . . . . . . . . . . . . . . . . .
xxiv
Contents
493
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and Command
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Source Control Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
493
493
Mathematics, MATLAB Version 7.0.1 (R14SP1) . . . . . . .
New Function — ordeig . . . . . . . . . . . . . . . . . . . . . . . . . . . .
More Functions Accept Single-Precision Data Inputs . . . .
New Vendor BLAS Used for Linear Algebra in MATLAB . .
Overriding the Default BLAS Library on Sun/Solaris
Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FDLIBM Version Upgraded . . . . . . . . . . . . . . . . . . . . . . . . .
Different Results When Solving Singular Linear Systems
on Intel Systems; Inconsistent NaN Propagation . . . . . .
funm Returns Status Information; New Output Might
Result In Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
499
499
499
500
Programming, MATLAB Version 7.0.1 (R14SP1) . . . . . .
Character Set Conversion Functions Added . . . . . . . . . . . .
datevec Support of Empty String Argument . . . . . . . . . . . .
depfun Function Supports New Options . . . . . . . . . . . . . . .
ftell Returning Invalid Position in Rare Cases . . . . . . . . . .
fwrite Saves uint64 and int64 Types . . . . . . . . . . . . . . . . . .
mat2str Enhanced to Work with Non-double Types . . . . . .
nargin, nargout Operate on Function Handles . . . . . . . . . .
regexprep Now Supports Character Representations in
Replacement String . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logical OR Operator | in regexp Expressions Might Yield
Different Results from Previous Version . . . . . . . . . . . . .
Multiple Declarations of Persistent Variables No Longer
Supported . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Declaration Compatibililty with Pre-R14
M-Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
503
503
504
504
504
505
505
505
Graphics, MATLAB Version 7.0.1 (R14SP1) . . . . . . . . . . .
OpenGL Trouble Shooting . . . . . . . . . . . . . . . . . . . . . . . . . .
Compatibility Considerations . . . . . . . . . . . . . . . . . . . . . . . .
509
509
509
494
495
495
496
497
497
500
501
501
502
506
506
507
508
xxv
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7.0.1 (R14SP1) . . . . . . . . . . . . . . . . . . . . . . . . . . .
FIG-File Format Change . . . . . . . . . . . . . . . . . . . . . . . . . . .
Panels, Button Groups, and ActiveX Components . . . . . . .
Comments Now Optional for Newly Generated Callback
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows XP Display of Push and Toggle Buttons . . . . . . .
External Interfaces/API, MATLAB Version 7.0.1
(R14SP1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Handles in COM Event Callbacks . . . . . . . . . . . .
Registering Events for COM Servers and Controls . . . . . .
Expanded Support for Web Services (SOAP and WSDL) . .
Specifying the Search Path for Sun Java Native Method
DLLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MATLAB DDE Server Is Now Disabled By Default . . . . . .
Clearing MEX-Functions . . . . . . . . . . . . . . . . . . . . . . . . . . .
510
510
510
511
511
513
513
513
513
513
514
515
Version 7 (R14) MATLAB Software
15
Desktop Tools and Development Environment,
MATLAB Version 7 (R14) . . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Running Functions — Command Window and Command
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Workspace, Search Path, and File Operations . . . . . . . . . .
Editing and Debugging M-Files . . . . . . . . . . . . . . . . . . . . . .
Tuning and Managing M-Files . . . . . . . . . . . . . . . . . . . . . . .
Source Control Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publishing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematics, MATLAB Version 7 (R14) . . . . . . . . . . . . . .
New and Obsolete Functions . . . . . . . . . . . . . . . . . . . . . . . .
Nondouble Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Matrices and Elementary Math . . . . . . . . . . . . . . . . . . . . . .
Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nonlinear Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxvi
Contents
519
519
520
524
528
531
536
542
546
546
548
548
548
548
549
549
Trigonometry, Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specialized Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Obsolete Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Nondouble Mathematics Features . . . . . . . . . . . . . . . .
Nondouble Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Integer Functions — intmax and intmin . . . . . . . . . .
New Warnings for Integer Arithmetic . . . . . . . . . . . . . . . . .
Warning on Concatenating Different Integer Classes . . . .
Integer Data Type Functions Now Round Instead of
Truncate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Behavior of Concatenation . . . . . . . . . . . . . . . .
Class Input for realmax and realmin . . . . . . . . . . . . . . . . . .
Class Input for ones, zeros, and eye . . . . . . . . . . . . . . . . . . .
Class and Size Inputs for Inf and NaN . . . . . . . . . . . . . . . .
New Class and Data Inputs for eps . . . . . . . . . . . . . . . . . . .
New Class Inputs for sum . . . . . . . . . . . . . . . . . . . . . . . . . .
complex Now Accepts Inputs of Different Data Types . . . .
Bit Functions Now Work on Unsigned Integers . . . . . . . . .
New Function accumarray for Constructing Arrays with
Accumulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhanced sort Capabilities and Performance . . . . . . . . . . .
New Functions for Numerical Data Types . . . . . . . . . . . . .
max and min Now Have Restrictions on Inputs of Different
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematic Operations on Logical Values . . . . . . . . . . . . .
New Function linsolve for Solving Systems of Linear
Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Output for polyeig . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhancements to lscov . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Form for Generalized Hessian . . . . . . . . . . . . . . . . . . .
New Function quadv Integrates Complex, Array-Valued
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Trigonometric Functions For Angles in Degrees . . . .
Matrix, Trigonometric, and Other Math Functions No
Longer Accept Inputs of Type char . . . . . . . . . . . . . . . . .
New Warnings for Complex Inputs to atan2, log2, and
pow2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhanced Functions for Computational Geometry . . . . . . .
New Support for Interpolation Functions . . . . . . . . . . . . . .
549
549
550
550
550
550
550
551
551
552
553
553
554
555
556
556
557
558
558
559
560
560
560
561
562
562
563
563
563
564
564
565
565
566
566
567
567
xxvii
New and Enhanced Functions for Ordinary Differential
Equations (ODEs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enhancements to Discrete Fourier Transform Functions . .
FFT Functions Applied to Integer Data Types are Becoming
Obsolete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Output Function for Optimization Functions . . . . . . .
New Input Argument for Incomplete Gamma Function . . .
Overriding the Default BLAS Library on Intel/Windows
Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Names for Demos expm1, expm2, and expm3 . . . . . . .
Programming, MATLAB Version 7 (R14) . . . . . . . . . . . . .
Save and Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Dispatching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changes to Specific Functions . . . . . . . . . . . . . . . . . . . . . . .
Specific Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Characters and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MATLAB Stores Character Data As Unicode; Making
Release 14 MAT-files Readable in Earlier Versions . . . .
MAT-Files Generated By Release 14 Beta2 Must Be
Reformatted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unicode-Based Character Classification . . . . . . . . . . . . . . .
Character Rendering on Linux . . . . . . . . . . . . . . . . . . . . . . .
Additional Bytes Reserved in MAT-File Header; Do Not
Write To Reserved Space . . . . . . . . . . . . . . . . . . . . . . . . .
Compressed Data Support in MAT-Files . . . . . . . . . . . . . . .
Saving Structures with the save Function . . . . . . . . . . . . .
Case-Sensitivity in Function and Directory Names; Can
Affect Which Function MATLAB Selects . . . . . . . . . . . .
Differences Between Built-Ins and M-Functions Removed;
Can Affect Which Function MATLAB Selects . . . . . . . . .
Warning on Naming Conflict . . . . . . . . . . . . . . . . . . . . . . . .
Change to How evalin Evaluates Dispatch Context . . . . . .
Summary of New Functions . . . . . . . . . . . . . . . . . . . . . . . . .
New Function Type — Anonymous Functions . . . . . . . . . .
New Function Type — Nested Functions . . . . . . . . . . . . . .
Calling Private Functions From Scripts . . . . . . . . . . . . . . .
New Calling Syntax for Function Handles; Replace eval
With New Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxviii
Contents
568
569
569
570
570
571
572
573
573
573
574
574
574
574
575
575
576
576
576
577
578
578
578
579
579
579
584
586
586
587
588
590
591
591
Arrays of Function Handles . . . . . . . . . . . . . . . . . . . . . . . . .
Calling nargin and nargout with Built-In Functions . . . . .
Comma Separators Not Required in Function
Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
getfield and setfield Not To Be Deprecated . . . . . . . . . . . . .
isglobal Function To Be Discontinued . . . . . . . . . . . . . . . . .
Recycle to Protect Files from Unwanted Deletion . . . . . . . .
bin2dec Ignores Space Characters . . . . . . . . . . . . . . . . . . . .
dbstop crashes Are Now Resolved . . . . . . . . . . . . . . . . . . . .
Bit Functions on Unsigned Integers . . . . . . . . . . . . . . . . . .
inmem Returns Path Information . . . . . . . . . . . . . . . . . . . .
New Features for Nondouble Data Types . . . . . . . . . . . . . .
Mathematic Operations on Logical Values . . . . . . . . . . . . .
Accessing Cell and Structure Arrays Without deal . . . . . . .
New Features in Regular Expression Support . . . . . . . . . .
Functions that Use Regular Expressions . . . . . . . . . . . . . .
Regular Expressions Accept String Vector; No Longer
Support Character Matrix Input . . . . . . . . . . . . . . . . . . .
Cell Array Support for String Functions . . . . . . . . . . . . . . .
Additional Class Output From mat2str . . . . . . . . . . . . . . . .
String Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using strtok on Cell Arrays of Strings . . . . . . . . . . . . . . . . .
Colon Operator on char Now Returns a char . . . . . . . . . . .
datestr Returns Date In Localized Format . . . . . . . . . . . . .
Form and Locale for weekday . . . . . . . . . . . . . . . . . . . . . . . .
Freestyle Date String Format . . . . . . . . . . . . . . . . . . . . . . .
Reading Date Values with xlsread; Conversion No Longer
Necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comprehensive Function for Reading Text Files . . . . . . . .
New Inputs and Outputs to xlsread . . . . . . . . . . . . . . . . . . .
New Inputs and Syntax for dlmwrite . . . . . . . . . . . . . . . . . .
Change in Output from xlsfinfo . . . . . . . . . . . . . . . . . . . . . .
Importing Complex Arrays . . . . . . . . . . . . . . . . . . . . . . . . . .
Using imread to Import Subsets of TIFF Images . . . . . . . .
Getting Information about Multimedia Files . . . . . . . . . . .
All-Platform Audio Recording and Playback . . . . . . . . . . . .
FTP File Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Services (SOAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64-Bit File Handling on MacIntosh . . . . . . . . . . . . . . . . . . .
Changes to Error Message Format . . . . . . . . . . . . . . . . . . .
nargchk Has a New Format for Error Messages . . . . . . . . .
Enabling and Disabling Warning Messages . . . . . . . . . . . .
Catching Ctrl+C in try-catch Statements . . . . . . . . . . . . . .
MATLAB Performance Acceleration . . . . . . . . . . . . . . . . . .
592
592
593
593
593
594
594
594
595
595
595
595
595
596
597
598
598
598
599
599
599
600
600
600
600
601
602
602
603
604
604
605
605
606
606
606
606
609
610
610
611
xxix
Assignment Error Removed . . . . . . . . . . . . . . . . . . . . . . . . .
“Using MATLAB” Documentation Is Now Three Books . . .
611
612
Graphics and 3-D Visualization, MATLAB Version 7
(R14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plotting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Exploration Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotation Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Plot Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Group Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linking Graphics Object Properties . . . . . . . . . . . . . . . . . . .
New Behavior for Hold Command . . . . . . . . . . . . . . . . . . . .
Enhancements to findobj . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Ancestor Function Returns Object’s Ancestry . . . . . .
New Axes Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Figure Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Root Object Property . . . . . . . . . . . . . . . . . . . . . . . . . .
New Dialog for Exporting Figures . . . . . . . . . . . . . . . . . . . .
Compatibility Considerations . . . . . . . . . . . . . . . . . . . . . . . .
613
613
614
614
614
615
617
617
617
617
617
618
618
619
619
620
Creating Graphical User Interfaces (GUIs), MATLAB
Version 7 (R14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Container Components . . . . . . . . . . . . . . . . . . . . . . . . .
ActiveX Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New Toolbar Component . . . . . . . . . . . . . . . . . . . . . . . . . . .
Menu Editor Enhancements . . . . . . . . . . . . . . . . . . . . . . . . .
Layout Resize Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Key Press Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit Text Box Scroll Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Uicontrol Focus . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiple Selection in uigetfile . . . . . . . . . . . . . . . . . . . . . . .
Program Suspension Time-Out . . . . . . . . . . . . . . . . . . . . . .
Standard Dialog Box Push Buttons . . . . . . . . . . . . . . . . . . .
New Syntax for uigetfile and uiputfile . . . . . . . . . . . . . . . . .
Frames Not Available in GUIDE Layout Editor . . . . . . . . .
622
622
623
623
624
624
625
625
625
626
626
626
626
627
External Interfaces/API, MATLAB Version 7 (R14) . . . .
Importing and Exporting . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft® ActiveX and COM Interface . . . . . . . . . . . . . . . .
MATLAB Interface to Sun Java Programming
Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xxx
Contents
628
628
629
636
637
Compatibility Summary for MATLAB Software
16
Version 7.11 (R2010b) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
641
Version 7.10 (R2010a) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
643
Version 7.9 (R2009b) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
645
Version 7.8 (R2009a) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
647
Version 7.7 (R2008b) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
649
Version 7.6 (R2008a) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
652
Version 7.5 (R2007b) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
655
Version 7.4 (R2007a) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
658
Version 7.3 (R2006b) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
661
Version 7.2 (R2006a) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
664
Version 7.1 (R14SP3) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
666
Version 7.04 (R14SP2) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
668
xxxi
xxxii
Contents
Version 7.01 (R14SP1) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
670
Version 7 (R14) MATLAB Software Compatibility
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
672
MATLAB Release Notes
Summary by Version
This table provides quick access to what’s new in each version. For
clarification, see “Using Release Notes” on page 2.
Version
(Release)
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Latest Version
V7.11 (R2010b)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
Printable
Release Notes:
PDF
Current product
documentation
V7.10 (R2010a)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.9.1
(R2009bSP1)
No
No
Bug Reports
Includes fixes
No
V7.9 (R2009b)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.8 (R2009a)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.7 (R2008b)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.6 (R2008a)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
1
MATLAB® Release Notes
Version
(Release)
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
V7.5 (R2007b)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.4 (R2007a)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.3 (R2006b)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.2 (R2006a)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.1 (R14SP3)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.0.4 (R14SP2)
Yes
Details
Yes
Summary
Bug Reports
Includes fixes
No
V7.0.1 (R14SP1)
Yes
Details
Yes
Summary
Fixed bugs
No
V7 (R14)
Yes
Details
Yes
Summary
Fixed bugs
No
Using Release Notes
Use release notes when upgrading to a newer version to learn about:
• New features
• Changes
• Potential impact on your existing files and practices
Review the release notes for other MathWorks® products required for this
product (for example, MATLAB® or Simulink®). Determine if enhancements,
bugs, or compatibility considerations in other products impact you.
2
Summary by Version
If you are upgrading from a software version other than the most recent one,
review the current release notes and all interim versions. For example, when
you upgrade from V1.0 to V1.2, review the release notes for V1.1 and V1.2.
What Is in the Release Notes
New Features and Changes
• New functionality
• Changes to existing functionality
Version Compatibility Considerations
When a new feature or change introduces a reported incompatibility between
versions, the Compatibility Considerations subsection explains the
impact.
Compatibility issues reported after the product release appear under Bug
Reports at the MathWorks Web site. Bug fixes can sometimes result
in incompatibilities, so review the fixed bugs in Bug Reports for any
compatibility impact.
Fixed Bugs and Known Problems
MathWorks offers a user-searchable Bug Reports database so you can view
Bug Reports. The development team updates this database at release time
and as more information becomes available. Bug Reports include provisions
for any known workarounds or file replacements. Information is available
for bugs existing in or fixed in Release 14SP2 or later. Information is not
available for all bugs in earlier releases.
Access Bug Reports using your MathWorks Account.
3
Version 7.11 (R2010b)
MATLAB Software
This table summarizes what’s new in Version 7.11 (R2010b).
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
Printable
Release Notes:
PDF
Current product
documentation
New features and changes introduced in this version are organized under
these topics:
• “Desktop Tools and Development Environment, MATLAB Version 7.11
(R2010b)” on page 7
• “Mathematics, MATLAB Version 7.11 (R2010b)” on page 14
• “Data Analysis, MATLAB Version 7.11 (R2010b)” on page 17
• “Programming, MATLAB Version 7.11 (R2010b)” on page 20
• “Graphics and 3-D Visualization, MATLAB Version 7.11 (R2010b)” on
page 28
5
Version 7.11 (R2010b) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.11
(R2010b)” on page 29
• “External Interfaces/API, MATLAB Version 7.11 (R2010b)” on page 31
6
Desktop Tools and Development Environment, MATLAB® Version 7.11 (R2010b)
Desktop Tools and Development Environment, MATLAB
Version 7.11 (R2010b)
New features and changes introduced in this version are:
• “Desktop” on page 7
• “Help Browser” on page 9
• “Managing Files” on page 10
• “Editing and Debugging MATLAB Code” on page 11
Desktop
New desktop features and changes introduced in Version 7.11 (R2010b) are:
• “Ability to Customize the Date Format ” on page 7
• “Keyboard Shortcuts Preferences Integrated with File Exchange” on page 8
• “MATLAB Provides Enumeration Template” on page 8
Ability to Customize the Date Format
You can now customize the date format that the Current Folder browser
and the Command History window use to display dates, such as the dates
indicated here:
7
Version 7.11 (R2010b) MATLAB® Software
Previously, the date format in both of these tools was M/d/yy (for instance,
6/4/90 for June 4, 1990) and you could not change it. Now, both tools use
the operating system short date format. For details, see “Customizing the
Column Display”.
Keyboard Shortcuts Preferences Integrated with File Exchange
MATLAB now integrates keyboard shortcuts preferences with File Exchange.
You can access File Exchange directly from the Keyboard Shortcuts
Preferences panel and find:
• MATLAB keyboard shortcuts available in Version 7.9 (R2009a) and earlier
releases
• Keyboard shortcuts sets created by other MATLAB users
For details, see “Downloading Keyboard Shortcut Settings Files from File
Exchange ”.
MATLAB Provides Enumeration Template
MATLAB provides a template for classes that define enumerations.
Enumeration classes enable you to define a fixed set of names representing
8
Desktop Tools and Development Environment, MATLAB® Version 7.11 (R2010b)
a particular type of value. Choose File > New > Enumeration. For more
information, see “Enumerations”.
Help Browser
• “New Language Preference for Help Browser” on page 9
• “Accessing Product Documentation in Japanese” on page 9
New Language Preference for Help Browser
If your system displays documentation in Japanese, you can use the
Language panel in the Help Preferences dialog to instruct the Help browser
to display documentation in English instead of Japanese. You can toggle
between languages with the preference panel, enabling you to revert to
Japanese at any time. The option changes the language used in the Help
Browser and for GUI context-sensitive help, but it does not affect the language
appearing in menus or elsewhere in products.
For example, the help command still provides help in Japanese after you
switch the Help browser to English. The Language preference is available
only when the system locale is Japanese and the Japanese documentation
is installed. If the documentation for a product is not translated, the Help
Browser displays the English documentation for it no matter how you set
the preference.
Accessing Product Documentation in Japanese
MathWorks usually provides Japanese translations of product documentation
about 2 months after new versions of products first ship. When you install the
new version of a product, the previous version of translated documentation is
installed in most cases.
To read the most current documentation for your release, switch the Help
browser to English. After the translations of the latest documentation are
available, you can download and install them in your products. At that time,
you can find a link to download the latest translated documentation on the
Japanese documentation start page.
9
Version 7.11 (R2010b) MATLAB® Software
Managing Files
New features and changes introduced in Version 7.11 (R2010b) are:
• “Ability to View Zip File Contents in Current Folder Browser” on page 10
• “Details Panel of Current Folder Provides Preview of Graphic Files” on
page 10
• “Current Folder Browser Indicates Whether File Is Modified in Editor”
on page 10
• “Compare Zip Files and Folders” on page 11
• “Enhanced Comparison Tool” on page 11
Ability to View Zip File Contents in Current Folder Browser
Using the Current Folder browser, you can now view the files in a zip file
without having to extract them. This feature enables you to:
• Confirm the contents of a newly created zip file
• Selectively open items from a zip file
• Add or remove files from the zip file
For details, see “Creating and Managing Zip File Archives” or watch the Zip
File Browsing video demo.
Details Panel of Current Folder Provides Preview of Graphic
Files
Now, when you select a JPEG, JPG, BMP, WBMP, PNG, or GIF image in the Current
Folder browser, the Details panel displays a thumbnail of the image and lists
its width and height in pixels. For more information, see “Viewing File Details
Without Opening Files” or watch the File Preview Enhancements video demo.
Current Folder Browser Indicates Whether File Is Modified in
Editor
Now, if you modify a file in the Editor, but have not yet saved the changes,
the Current Folder browser indicates the file state. An asterisk (*) appears
next to the name of such a file in the Current Folder browser. In addition,
10
Desktop Tools and Development Environment, MATLAB® Version 7.11 (R2010b)
when you select such a file in the Current Folder browser, the detail panel
reflects the modified file, not the file saved on disk. This feature is useful
when you are creating zip files and want to be sure that all files included in
the archive are saved and up-to-date. For details see, “Viewing File Details
Without Opening Files” or watch the File Preview Enhancements video demo.
Compare Zip Files and Folders
You can now compare any combinations of zip files, folders, and Simulink
Manifests with the Comparison Tool. Right-click files or folders in the
Current Folder browser and choose Compare Selected Files/Folders, or
Compare Against > Choose.
For details, see Comparing Folders and Zip Files.
Enhanced Comparison Tool
The Comparison Tool now provides the following capabilities:
• Select what type of comparison to run from a list of possible comparison
options, e.g., text, binary or XML comparison.
• Enhanced MAT-file comparisons now include size, data type and change
summary.
• New option to ignore whitespace changes in text comparisons.
For details, see “Comparing Files and Folders”.
Editing and Debugging MATLAB Code
New Desktop features and changes introduced in Version 7.11 (R2010b) are:
• “Ability to Save File to Backup Without Closing That File” on page 12
• “Enhanced Comment Wrapping” on page 12
• “Variable and Function Highlighting” on page 12
• “Options for Setting Current Folder and Search Path Available from Editor
Context Menu” on page 13
• “Open As Text Option” on page 13
11
Version 7.11 (R2010b) MATLAB® Software
Ability to Save File to Backup Without Closing That File
You now can save a file that is open in the Editor to a backup file. Select
File > Save Backup, and then specify a backup file name. The file that is
active in the Editor when you perform the save operation remains active. If
changes to the active file prove problematic, you can use the backup file to
return to a known state or to compare with the active file. This comparison
can help you determine where errors exist.
For information on other save options, see “Saving Files”.
Enhanced Comment Wrapping
The enhanced ability to wrap MATLAB comments includes:
• Wrapping an entire block of comments by selecting File > Wrap
Comments.
There is no need to select the block of comments first. For details see
“Wrapping Comments in MATLAB Code”
• Specifying where you want column counting to begin.
For example, if you indent comments, you can specify that you want
the maximum width of comments to be 75 columns from the start of a
comment, rather than from the start of a line. For details, see “Setting
MATLAB Language Preferences”.
Variable and Function Highlighting
The Editor now presents variables that are not local variables in a teal blue
color, by default. Also by default, when you click a function or local variable,
the Editor highlights it and all other references to it in a sky blue color. As
demonstrated in the Variable and Subfunction Highlighting video demo, this
feature makes it easier to:
• Find unintentional reuses of a variable within a nested function
For details, see “Determining Scope and Usage of Functions and Variables”.
• Navigate through a file from function to function reference or variable
to variable reference
For details, see “Navigating to a Specific Location”.
12
Desktop Tools and Development Environment, MATLAB® Version 7.11 (R2010b)
• Search a file for a particular function or variable name
For details, see “Finding and Replacing Functions or Variables in the
Current File”.
Use preferences to disable or change the colors that the Editor uses for
variable and function highlighting. For details, see “Setting Color Preferences
for Programming Tools”.
Options for Setting Current Folder and Search Path Available
from Editor Context Menu
When multiple documents are open and docked in the Editor, you can
right-click the document tab, and then from the context menu choose:
• Change Current Folder to folder-name
• Add folder-name to Search Path or Remove folder-name from
Search Path, respectively
• Locate on Disk
This option locates the document in your operating system file browser. It
is not available on Linux® platforms.
• Copy Full Path to Clipboard
Open As Text Option
You can use the File > Open as Text option to open a file in the Editor as a
text file, even if the file type is associated with another application or tool.
This feature is useful, for example, if you import a tab-delimited data file
(.dat) into the workspace, and then you find you want to add a data point.
For details, see “Opening Existing Files Using the Editor”.
13
Version 7.11 (R2010b) MATLAB® Software
Mathematics, MATLAB Version 7.11 (R2010b)
New features and changes introduced in this version are:
• “64-Bit Integer Arithmetic” on page 14
• “New Utility Functions: isrow, iscolumn, ismatrix” on page 14
• “Output Option for Point Distances in DelaunayTri/nearestNeighbor
Method” on page 14
• “Changes to convhull and delaunay Functions” on page 15
• “Performance Enhancements” on page 15
• “Functions Being Removed” on page 15
• “optimset Errors for Optimization Toolbox Options” on page 16
• “atan Warning Being Removed” on page 16
64-Bit Integer Arithmetic
Core MATLAB arithmetic functions now support int64 and uint64 classes
natively. Functions added are plus (+), minus (–), uminus (–), times (.*),
rdivide (./), ldivide (.\), power (.^), rem, mod, bitcmp, any, all, sum, diff,
colon (:), sign, accumarray, and bsxfun.
New Utility Functions: isrow, iscolumn, ismatrix
New functions isrow, iscolumn, and ismatrix provide basic information
about inputs.
Output Option for Point Distances in
DelaunayTri/nearestNeighbor Method
The two-output form of DelaunayTri/nearestNeighbor returns the
corresponding Euclidean distances between the query points and their
nearest neighbors.
14
Mathematics, MATLAB® Version 7.11 (R2010b)
Changes to convhull and delaunay Functions
The functions convhull and delaunay now support 3-D input in either
multiple vector or multicolumn matrix format. In addition, the simplify
option for convhull provides the option of removing vertices that do not
contribute to the area or volume of the convex hull.
Performance Enhancements
• Three-Output Form of svd
The three-output form of svd displays significantly enhanced performance.
• Sparse Column Assignment
The assignment of elements into multiple columns of a MATLAB sparse
matrix displays significantly enhanced performance.
• Trigonometric Functions
All degree-based trigonometric functions (sind, cosd, tand, cotd, secd,
cscd) and their inverses (asind, acosd, atand, acotd, asecd, acscd)
display significantly enhanced performance.
Functions Being Removed
Function Name
What Happens
When You Use
This Function
Use This
Function
Instead
Compatibility
Considerations
bessel
Warns
besselj
Replace all
instances of
bessel with
besselj.
erfcore
Errors
erf, erfc, erfcx,
erfinv, or
erfcinv
See the function
reference pages
for the individual
functions.
intwarning
Errors
None
Remove all
instances of
intwarning from
your code.
15
Version 7.11 (R2010b) MATLAB® Software
optimset Errors for Optimization Toolbox Options
If you do not have an Optimization Toolbox™ license, and you set an optimset
option for a solver that is only available in Optimization Toolbox, optimset
errors. Previously, optimset would warn, not error, and ignore the option.
Compatibility Considerations
Change your code to set only those options that apply to your solver: fminbnd,
fminsearch, fzero, or lsqnonneg.
atan Warning Being Removed
When you use atan(1i) and atan(-1i) you no longer get a warning.
Compatibility Considerations
Remove instances of the warning ID MATLAB:atan:singularity from your
code.
16
Data Analysis, MATLAB® Version 7.11 (R2010b)
Data Analysis, MATLAB Version 7.11 (R2010b)
Arrays of Time Series Objects Supported
MATLAB now enables you to create arrays of timeseries objects. In Version
7.10 (R2010a) and before, timeseries objects behaved as arrays, but some
array behavior was overridden.
Compatibility Considerations
Note It is likely that this change is important to you only if you write code
that uses timeseries objects.
In Version 7.11 (R2010b), all of the overridden behaviors for the functions
listed in the table that follows are removed. The behavior of these functions
on timeseries objects is the built-in behavior for arrays of objects. Think of a
timeseries object as a single object that you can concatenate into an array of
objects. Do not think of each timeseries itself as an array.
Functions Being Modified
Function or
Function Element
Name
What
Happens
When You Use
the Function
or Element?
Use This Instead
Compatibility
Considerations
horzcat
No error or
warning
Not applicable
You can now use horzcat
with timeseries objects.
isempty
(timeseries)
No error or
warning
timeseries.Length==0
Replace code such as:
isempty(ts)
with:
ts.Length == 0
17
Version 7.11 (R2010b) MATLAB® Software
Function or
Function Element
Name
What
Happens
When You Use
the Function
or Element?
Use This Instead
length
(timeseries)
No error or
warning
timeseries.Length
property
Compatibility
Considerations
Replace code such as:
length(ts)
with:
ts.Length
size
(timeseries)
No error or
warning
[timeseries.Length 1]
Replace code such as:
size(ts)
with:
[ts.Length 1]
subsref
No error or
warning
getsamples
Replace code such as:
t3 = t1(1:3);
with:
getsamples(t1,1:3);
vertcat
(timeseries)
May return
append
Index exceeds
matrix
dimension
Replace code such as:
t3 = [t1;t2];
with
t3 = append(t1,t2);
error
Example of timeseries Object Concatenation
Suppose you concatenate the following two timeseries objects:
t1 = timeseries(ones(5,1),0:4);
t2 = timeseries(zeros(5,1),5:9);
In R2010a, the following syntax created a single timeseries object, t3, with
10 samples spanning the time range 0-9. The first 5 samples derived from t1
and the last 5 samples derived from t2. The size of the timeseries, t3, was
[10 1] and its length was 10, because t3 has 10 samples.
t3 = [t1;t2]
t3 = vertcat(t1,t2)
18
Data Analysis, MATLAB® Version 7.11 (R2010b)
Now, the same syntax creates a 2x1 array comprising the two timeseries
objects t1 and t2. Its size is [2 1], and its length is 2 because the array has
two rows, each a single timeseries.
19
Version 7.11 (R2010b) MATLAB® Software
Programming, MATLAB Version 7.11 (R2010b)
New features and changes introduced in this version are
• “arrayfun Accepts Array of Objects” on page 20
• “Comparing Object Arrays that Contain NaNs” on page 20
• “Functions isa and islogical Now Consistent for Objects” on page 21
• “New Enumeration Classes” on page 21
• “New Functionality for Writing Video Files” on page 21
• “mmreader Renamed VideoReader” on page 22
• “New HDF4 Functions” on page 22
• “New HDF5 Low-Level Functions” on page 22
• “New netCDF Functions” on page 23
• “Upgrades to Scientific File Format Libraries” on page 24
• “New Examples in Command Line Help” on page 24
• “imread and imwrite Can Now Handle N-channel J2C JPEG 2000 Files”
on page 24
• “csvread and csvwrite Will Not Be Removed” on page 25
• “Functions and Function Elements Being Removed” on page 25
• “MATLAB Did Not Pass struct to loadobj When Property Was Deleted”
on page 26
arrayfun Accepts Array of Objects
The arrayfun function now accepts an array of objects as an input. The output
can also be a scalar object, as long as the UniformOutput flag is set to false.
Comparing Object Arrays that Contain NaNs
In previous versions of MATLAB, calling isequalwithequalnans to compare
identical arrays of objects that contain one or more NaN (Not a Number)
values incorrectly returned false. Similarly, calling isequal to compare
identical arrays of objects that contain NaNs incorrectly returned true.
20
Programming, MATLAB® Version 7.11 (R2010b)
In MATLAB version 7.11, these functions return the expected values (true
for isequalwithequalnans, and false for isequal) when used to compare
object arrays.
Compatibility Considerations
Program code that compares object arrays that may contain NaNs should be
examined to ensure correct behavior.
Functions isa and islogical Now Consistent for
Objects
In earlier releases of MATLAB, the following statements returned different
results for objects with a base class of logical:
isa(obj, 'logical')
islogical(obj)
In MATLAB version 7.11, both of these statements return true if the class of
obj is derived from logical, and false otherwise.
Compatibility Considerations
If you have program code that calls either isa or islogical on objects with a
base class of logical, it is advisable to verify that this new behavior does not
adversely affect the execution of the program.
New Enumeration Classes
MATLAB provides support for classes that define enumerations. Enumeration
classes enable you to define a fixed set of names representing a particular
type of value. See “Enumerations” for more information.
Use this link to watch a video that introduces enumerations: Play demo
New Functionality for Writing Video Files
The new VideoWriter function allows you to create AVI files on all platforms.
As an improvement over the avifile function, VideoWriter can create files
larger than 2 GB. For more information, watch this video demo or see the
VideoWriter reference page.
21
Version 7.11 (R2010b) MATLAB® Software
mmreader Renamed VideoReader
For consistency with the new VideoWriter class, the mmreader class is now
called VideoReader. A new function, VideoReader, replaces the mmreader
function. VideoReader and mmreader return identical VideoReader objects
for the same input file.
Compatibility Considerations
Replace all instances of mmreader with VideoReader. The two functions use
identical syntax. When requesting help or documentation for methods from
the command line, or calling a static method such as getFileFormats, use the
new VideoReader class name (such as doc VideoReader/read). You do not
need to change any calls to the read, get, or set methods.
Previously, the R2010a Release Notes recommended replacing instances of
aviinfo with mmreader and get, and instances of aviread with mmreader
and read. Instead, replace aviinfo with VideoReader and get, and replace
aviread with VideoReader and read.
New HDF4 Functions
The MATLAB interface to the grid functions in the HDF-EOS C library,
hdfgd, now includes three new syntaxes. These syntaxes convert grid
coordinates to longitude and latitude values.
• ij2ll
• ll2ij
• rs2ll
To view the help for these functions, use the help command at the MATLAB
prompt, as in the following example:
help hdfgd
New HDF5 Low-Level Functions
The MATLAB interfaces to the HDF5 C library now include the following
new functions.
• H5A.open_by_idx
22
Programming, MATLAB® Version 7.11 (R2010b)
• H5A.open_by_name
• H5D.get_access_plist
• H5I.is_valid
• H5L.copy
• H5L.get_name_by_idx
• H5P.set_chunk_cache
• H5P.get_chunk_cache
• H5P.set_copy_object
• H5P.get_copy_object
To view the help for these functions, use the help command at the MATLAB
prompt, as in the following example:
help H5P.get_copy_object
New netCDF Functions
The MATLAB interface to the netCDF C library now includes the following
new functions.
• netcdf.inqFormat
• netcdf.inqUnlimDims
• netcdf.defGrp
• netcdf.inqNcid
• netcdf.inqGrps
• netcdf.inqVarIDs
• netcdf.inqDimIDs
• netcdf.inqGrpName
• netcdf.inqGrpNameFull
• netcdf.inqGrpParent
• netcdf.defVarChunking
23
Version 7.11 (R2010b) MATLAB® Software
• netcdf.defVarDeflate
• netcdf.defVarFill
• netcdf.defVarFletcher32
• netcdf.inqVarChunking
• netcdf.inqVarDeflate
• netcdf.inqVarFill
• netcdf.inqVarFletcher32
To view the help for these functions, use the help command at the MATLAB
prompt, as in the following example:
help netcdf.inqVarFletcher32
Upgrades to Scientific File Format Libraries
The following table lists upgrades to scientific file format libraries used by
MATLAB.
Library
Version Upgrade
netCDF
3.6.2 to 4.0.1
New Examples in Command Line Help
The MATLAB command line help for the HDF5, netCDF, and CDF low-level
functions now includes hundreds of new examples.
imread and imwrite Can Now Handle N-channel J2C
JPEG 2000 Files
You can now use the imread and imwrite functions with n-channel J2C
JPEG 2000 files.
J2C files are raw JPEG2000 codestreams that usually have the file extension
.j2c or .j2k. J2C files don’t contain color space, color palette, capture
resolution, display resolution and vender specific information.
24
Programming, MATLAB® Version 7.11 (R2010b)
In previous releases, if you use imread to read a 4-channel J2C file, you receive
a warning that some channels may be ignored and imread returns a 3-channel
image. Now, imread returns a 4-channel image and does not issue a warning.
If you try to write a 4-channel J2C file in previous releases, imwrite issues an
error. In this release, imwrite creates the 4-channel J2C file.
csvread and csvwrite Will Not Be Removed
The R2010a Release Notes originally stated that csvread and csvwrite
would be removed in a future release. As of R2010b, there are no plans to
remove these functions.
Functions and Function Elements Being Removed
Function or Function Element
Name
What
Happens
When You
Use the
Function or
Element?
Use This
Instead
Compatibility
Considerations
fileparts return argument 4 (file
Warns, returns
empty fourth
argument
No
alternative;
file versions
are
unsupported
Call fileparts with
three return arguments:
Still runs,
creates a
VideoReader
Replace all existing
instances of mmreader
with VideoReader.
Replace all existing
instances of wavplay with
audioplayer and play.
version)
mmreader
VideoReader
[path_name file_name
file_extension]
object
wavplay
Still runs
audioplayer
and play
wavrecord
Still runs
audiorecorder Replace all existing
and record
instances of wavrecord
with audiorecorder and
record.
25
Version 7.11 (R2010b) MATLAB® Software
Use This
Instead
Compatibility
Considerations
Function or Function Element
Name
What
Happens
When You
Use the
Function or
Element?
wk1finfo
Warns
Remove all instances
of wk1finfo. Get
information about
Excel® spreadsheets
with xlsfinfo.
wk1read
Warns
Remove all instances
of wk1read. Read
Excel spreadsheets with
xlsread.
wk1write
Warns
Remove all instances
of wk1write. Write to
Excel spreadsheets with
xlswrite.
MATLAB Did Not Pass struct to loadobj When
Property Was Deleted
If you save an object having a property value equal to the property’s default
value, and then that property is removed from the class definition, MATLAB
did not detect the fact that the property was missing. In this case, MATLAB
did not build a struct to pass to loadobj. MATLAB now returns a struct
in this case.
Compatibility Considerations
If you rely on the following situation not returning a struct to loadobj, you
need to update your code:
• You saved an object using the save command
• This object had a property that was set to the default value defined by the
class at the time of saving
26
Programming, MATLAB® Version 7.11 (R2010b)
• The property set to its default value at save time is subsequently removed
from the class definition
• You load the property and expect the load operation to return an object (it
should return a struct because the class definition has changed in a way
the load cannot create the object).
• Your loadobj method is not prepared to use the returned struct to create
an object
You must implement a loadobj method to recreate the object using the
current class definition.
See “Saving and Loading Objects” for more information.
27
Version 7.11 (R2010b) MATLAB® Software
Graphics and 3-D Visualization, MATLAB Version 7.11
(R2010b)
New features and changes introduced in this version are:
• “Print –dmfile and printdmfile Issue Deprecation Warnings” on page 28
• “The saveas ’mmat’ option Issues a Deprecation Warning” on page 28
• “The movie Function is No Longer a Built-in Function” on page 28
Print –dmfile and printdmfile Issue Deprecation
Warnings
The dmfile print command option and the printdmfile function now
issue a deprecation warning. Both option and function will be removed in a
subsequent release. The dmfile option and the printdmfile function were
used by GUIDE.
The saveas ’mmat’ option Issues a Deprecation
Warning
The saveas function now issues a deprecation warning if you use the 'mmat'
format option. This option will be removed in a subsequent release. This
option was used with GUIDE.
The movie Function is No Longer a Built-in Function
The movie function is no longer a built-in function. Therefore, you cannot call
movie from the builtin function. movie syntax remains the same.
28
Creating Graphical User Interfaces (GUIs), MATLAB® Version 7.11 (R2010b)
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.11 (R2010b)
The changes introduced in this version are:
Functions and Function Elements Being Removed
The uitabgroup and uitab GUI components are undocumented features that
provide tabbed panels to GUIs that you create programmatically. The current
method of calling these functions and some of their properties will change in a
future release. MathWorks has never supported their use. However, if your
MATLAB code includes these functions, read the following information:
Function or Function
Element Name
What
Happens
When You
Use the
Function
or
Element?
Use This Instead
Compatibility Considerations
uitabgroup('v0',...)
uitab('v0',...)
Warns
uitabgroup(...)
uitab(...)
Using the 'v0' argument
generates a warning, but the object
is created.
uitabgroup property
SelectionChangeFcn
SelectionChange
Not
recommendedCallback
Event data for the callback is still
a struct with fields OldValue and
NewValue but those values are now
uitab handles, not uitab indexes.
uitabgroup property
SelectedIndex
SelectedTab
Not
recommended
Both properties still exist,
but replace instances of
SelectedIndex (an integer
tab index) with SelectedTab (a
handle to a uitab object).
29
Version 7.11 (R2010b) MATLAB® Software
Function or Function
Element Name
What
Happens
When You
Use the
Function
or
Element?
uitabgroup property
BackgroundColor
Not
no replacement
recommended
uitabgroup now uses the default
uicontrol background color.
uitabgroup event
SelectionChanged
Errors
Event name changed to be
consistent with other components.
Event data is still a struct with
fields OldValue and NewValue
but those values are now uitab
handles, not uitab indexes.
Use This Instead
SelectionChange
event
Compatibility Considerations
You should update any code that you maintain which uses the undocumented
uitabgroup and uitab functions to conform to the new standards, as
described in the “uitab and uitabgroup Migration Document”. Existing code
for these functions is unlikely to work in R2010b going forward.
30
External Interfaces/API, MATLAB® Version 7.11 (R2010b)
External Interfaces/API, MATLAB Version 7.11 (R2010b)
New features and changes introduced in this version are:
• “Changes to Compiler Support” on page 31
• “-largeArrayDims Option to MEX Will Become Default in Next Release of
MATLAB” on page 32
• “MEX Function -argcheck Option Removed” on page 33
• “MEX Function -inline Option Removed” on page 34
• “New Support for Features in Microsoft .NET Framework” on page 34
• “New COM Data Type Support” on page 34
Changes to Compiler Support
New Compiler Support
MATLAB Version 7.11 (R2010b) supports these new compilers for building
MEX-files:
Microsoft® Windows® (64- and 32-Bit) Platforms.
• Microsoft® Visual Studio® 2010 (10.0) Professional
• Microsoft Visual Studio 2010 (10.0) Express
Linux (64- and 32-Bit) Platforms.
• GNU® gcc Version 4.3.x
Compiler Support to Be Phased Out
Support for the following compilers will be discontinued in a future release, at
which time new versions will be supported. For an up-to-date list of supported
compilers, see the Supported and Compatible Compilers Web page.
Windows (64- and 32-Bit) Platforms.
• Intel® Visual Fortran Version 10.1
31
Version 7.11 (R2010b) MATLAB® Software
• Microsoft Visual Studio 2005 SP1
Discontinued Compiler Support
MATLAB no longer supports the following compilers:
Windows (64- and 32-Bit) Platforms.
• Intel C++ Version 9.1
Linux (64- and 32-Bit) Platforms.
• GNU gcc Version 4.2.3
Apple Macintosh® (32-Bit) Platforms.
• Apple® Xcode® 3.1 (gcc / g++ Version 4.0.1)
• GNU gfortran Version 4.2.2
Compatibility Considerations. To ensure continued support for building
your MEX-files, consider upgrading to another supported compiler. For an
up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
-largeArrayDims Option to MEX Will Become Default
in Next Release of MATLAB
In the next release of MATLAB, the mex command will change to use the
large-array-handling API by default. This means the -largeArrayDims
option will become the default.
You do not need to make changes to build and run MEX-files with MATLAB
Version 7.11 (R2010b).
Compatibility Considerations
Source for MEX-files built on 64-bit platforms must be updated in order to
successfully build and run with the next release of MATLAB. Review your
source MEX-files and mex build scripts. For information about migrating your
32
External Interfaces/API, MATLAB® Version 7.11 (R2010b)
MEX-files to use the large-array-handling API, see “Upgrading MEX-Files to
Use 64-Bit API”.
MEX Function -argcheck Option Removed
Function Option
Name
What Happens When
you use the Option?
Compatibility
Considerations
mex -argcheck option
Errors
Remove all existing
instances of -argcheck
in build scripts.
The -argcheck option was a strategy for identifying memory corruption
caused by a MEX-file. When you understand the likely causes of memory
corruption, you can take preventative measures in your code or use your
debugger to identify the source of errors.
If a binary MEX-file causes a segmentation violation or assertion, it means
the MEX-file attempted to access protected, read-only, or unallocated memory.
These types of programming errors are sometimes difficult to track down.
Segmentation violations do not always occur at the same point as the logical
errors that cause them. If a program writes data to an unintended section of
memory, an error might not occur until the program reads and interprets the
corrupted data. Consequently, a segmentation violation can occur after the
MEX-file finishes executing.
One cause of memory corruption is to pass a null pointer to a function.
To check for this condition, add code in your MEX-file to check for invalid
arguments to MEX Library and MX Matrix Library API functions.
To troubleshoot problems of this nature, run MATLAB within a debugging
environment. For more information, see “Debugging C/C++ Language
MEX-Files” or “Debugging Fortran Source MEX-Files”.
33
Version 7.11 (R2010b) MATLAB® Software
MEX Function -inline Option Removed
Function Option
Name
What Happens When
you use the Option?
Compatibility
Considerations
mex -inline option
Errors
Remove all existing
instances of -inline in
build scripts.
New Support for Features in Microsoft .NET
Framework
MATLAB supports:
• Using “.NET Delegates in the MATLAB Workspace”.
• “Accessing Microsoft Office 2007 Applications with .NET”.
• Using System.Nullable, described in “How MATLAB Handles
System.Nullable Type”.
• Calling constructors or NET.invokeGenericMethod with ref or out type
arguments.
• Calling methods with default arguments
(System.Reflection.Missing.Value is supported.)
New COM Data Type Support
Support for the following COM data type has been added. See “Handling
COM Data in MATLAB Software” for a description of supported data types.
• VT_I8 — signed int64
• VT_UI8 — unsigned int64
• Unsigned integer
34
Version 7.10 (R2010a)
MATLAB Software
This table summarizes what’s new in Version 7.10 (R2010a).
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized under
these topics:
• “Desktop Tools and Development Environment, MATLAB Version 7.10
(R2010a)” on page 37
• “Mathematics, MATLAB Version 7.10 (R2010a)” on page 46
• “Data Analysis, MATLAB Version 7.10 (R2010a)” on page 52
• “Programming, MATLAB Version 7.10 (R2010a)” on page 54
• “Graphics and 3-D Visualization, MATLAB Version 7.10 (R2010a)” on
page 61
35
Version 7.10 (R2010a) MATLAB® Software
• “External Interfaces/API, MATLAB Version 7.10 (R2010a)” on page 62
36
Desktop Tools and Development Environment, MATLAB® Version 7.10 (R2010a)
Desktop Tools and Development Environment, MATLAB
Version 7.10 (R2010a)
New features and changes introduced in this version are organized by these
topics:
• “Desktop New Features Video for R2010a” on page 37
• “Startup and Shutdown” on page 37
• “Desktop” on page 37
• “Help Browser” on page 39
• “Managing Files” on page 42
• “Editing and Debugging MATLAB Code” on page 45
Desktop New Features Video for R2010a
For an overview of the major new features in the MATLAB Desktop Tools and
Development Environment area, watch this video demo.
Startup and Shutdown
AUTOMOUNT_MAP Environment Variable No Longer Used by
MATLAB
On UNIX® systems, MATLAB no longer uses the AUTOMOUNT_MAP environment
variable, the path prefix map for automounting. Previously, MATLAB set the
value of the variable in .matlab7.rc, but you could override this setting
using the AUTOMOUNT_MAP environment variable.
Desktop
New Desktop features and changes introduced in Version 7.10 (R2010a) are:
• “Enhancements for Managing Keyboard Shortcuts” on page 38
• “Method for Accessing M-Lint Preferences and the M-Lint Report” on
page 38
• “Preference for Java Heap Memory” on page 38
37
Version 7.10 (R2010a) MATLAB® Software
Enhancements for Managing Keyboard Shortcuts
Keyboard shortcuts now provide the following:
• “Ability to List a Set of Keyboard Shortcuts in a Text Editor” on page 38
• “Ability to Remove Keyboard Shortcuts Sets” on page 38
• “Ability to Compare Sets of Keyboard Shortcuts” on page 38
Ability to List a Set of Keyboard Shortcuts in a Text Editor. You can
now list all of the keyboard shortcuts for a given set in a text editor. For
details, see “Listing All Keyboard Shortcuts in a Set”.
Ability to Remove Keyboard Shortcuts Sets. You can now remove
keyboard shortcut sets that you created or imported. For details, see “Deleting
a Set of Keyboard Shortcuts”.
Ability to Compare Sets of Keyboard Shortcuts. You can now compare
one set of keyboard shortcuts to another. This enables you, for example, to see
what is different between the current Windows default keyboard shortcuts
and those that were the defaults in MATLAB Version 7.8 (R2009a) and
earlier. For details, see “Comparing Sets of Keyboard Shortcuts”.
Method for Accessing M-Lint Preferences and the M-Lint Report
The M-Lint Preferences is now renamed the Code Analyzer Preference.
Therefore, to set preferences for analyzing MATLAB code, select
File > Preferences > Code Analyzer. Similarly, the M-Lint Report is now
renamed the Code Analyzer Report. To access this report, click the Actions
button
in the Current Folder browser, and then select Reports > Code
Analyzer Report. The names of the mlint and mlintrpt functions are
unchanged.
Preference for Java Heap Memory
A new preference setting allows you to adjust the amount of memory that
MATLAB allocates for storing Java™ objects. Insufficient memory for these
objects results in OutOfMemory errors. For more information, see “Java Heap
Memory Preferences”.
38
Desktop Tools and Development Environment, MATLAB® Version 7.10 (R2010a)
Compatibility Considerations. Technical Solution 1-18I2C specifies a
procedure for creating a text file named java.opts to set the Java heap
size. Do not use both the new MATLAB preference and a java.opts file to
adjust the heap size.
Help Browser
• “Improved Instructions and Examples for Adding Help and Demos to the
Help Browser” on page 39
• “New Search Hints” on page 40
• “Search History Persists Between Sessions” on page 40
• “Hide Search Results Previews” on page 41
• “docopt Function Removed” on page 41
For a demonstration of previous enhancements to the Help browser, watch
the Help Browser Enhancements video.
Improved Instructions and Examples for Adding Help and
Demos to the Help Browser
The MATLAB Desktop Environment User Guide now includes more details
about how to display your own HTML help and demos. In particular, the
documentation clarifies procedures for setting up files and folders and
provides three new XML file templates that you can inspect, copy, and modify.
The documentation also adds a new complete working example, called the
Upslope Area Toolbox. Documentation for the toolbox includes a getting
started guide, user guide, function reference pages, and release notes. The
documentation set is generated entirely from MATLAB script files (also
provided), using the publish command. The example folder includes all
program files for the toolbox. However, certain routines require Image
Processing Toolbox™ for full functionality.
You can also find the Upslope Area Toolbox on the MATLAB Central File
Exchange. For more information about techniques and algorithms the
toolbox uses, see the set of articles about it on this MATLAB Central blog:
http://blogs.mathworks.com/steve/category/upslope-area.
39
Version 7.10 (R2010a) MATLAB® Software
Find the updated documentation in “Customizing Help and Demos”. For
details, XML templates, and examples, see these subsections:
• “Adding HTML Help Files to the Help Browser”
• “Adding Demos to the Help Browser”
You can view the Upslope Toolbox documentation example in the Help
browser now by clicking here, which places its folder on the search path.
New Search Hints
The Help Browser now provides suggestions for search terms as you type
in the search field. These hints save you time and can suggest words and
phrases you might not have thought of but that can be useful in making a
search. The hints display as a drop-down menu that changes its contents as
you type. The following illustration shows the appearance of the menu.
For more information, see “Using Search Hints”.
Search History Persists Between Sessions
The Help browser can now recall searches you have made across MATLAB
sessions. Your search history and search hints display as separate lists in a
drop-down pane as you type in the search field. Select Show Search History
from the pop-up menu to the right of the search field, or press the down arrow
40
Desktop Tools and Development Environment, MATLAB® Version 7.10 (R2010a)
key in the search field when it is empty. The following illustration shows
search history and search hints as they appear when you enter search terms.
For more information, see “Using Search History”.
Hide Search Results Previews
You can now choose not to see the one-line descriptions of search results called
previews. To toggle all previews off, right-click in the Search Results pane of
the Help Navigator and choose Hide Previews. The search results listing is
smaller so you can scan it quickly when you hide previews. To see previews
again, right-click in the Search Results pane, and choose Show Previews.
See “Searching for Documentation and Demos”.
docopt Function Removed
This release obsoletes the docopt function, which specified which system Web
browser to use on UNIX platforms. This function has been removed. You
can instead specify a default system browser in your preferences. For more
41
Version 7.10 (R2010a) MATLAB® Software
information, see “New System Browser Preference Instead of docopt.m for
MATLAB on UNIX Platforms” on page 112.
Compatibility Considerations. If you call doctopt in your startup file or
some other program file, remove the call to avoid receiving an error.
Managing Files
• “Create and Expand Zipped Archives from Current Folder Browser” on
page 42
• “Visual Aids for Identifying Files Inaccessible to MATLAB” on page 42
• “Ability to Remove Folders and Subfolders from the Path Using the Current
Folder Browser” on page 43
• “Enhancements for File and Folder Comparisons” on page 44
Create and Expand Zipped Archives from Current Folder
Browser
Effective this release, the capability to create and expand, and archive .zip
files has been added to the Current Folder browser. Select files and folders
in the Current Folder browser, then right click, and choose Create Zip File
to create an archive. The archive appears in the current folder. You can
expand an archive in the same way. For details, see “Creating and Managing
Zip File Archives”.
Visual Aids for Identifying Files Inaccessible to MATLAB
This release changes the default behavior of the Current Folder browser. The
Current Folder browser now dims files that are inaccessible to MATLAB to
indicate their unavailability. A tooltip provides an explanation.
42
Desktop Tools and Development Environment, MATLAB® Version 7.10 (R2010a)
You can also customize or disable this feature. For more information, see
“Preferences for the Current Folder Browser” and “Viewing Files and Folders
on the Search Path”.
Ability to Remove Folders and Subfolders from the Path Using
the Current Folder Browser
You can now remove folders from the MATLAB path as follows:
1 In the Current Folder browser, right-click the folder you want to remove
from the path.
2 From the context menu, select Remove from Path, and then select
Selected Folders or Selected Folder and Subfolders.
If the default preferences for the Current Folder Path indication option
are set, the folders you removed now appear dimmed in the Current Folder
browser. For more information, see “Preferences for the Current Folder
Browser” and “Removing Folders from the Search Path”.
43
Version 7.10 (R2010a) MATLAB® Software
Enhancements for File and Folder Comparisons
This release enhances the File and Folder Comparisons tool to improve the
usability of comparisons between text files and folders.
File comparisons now highlight changes within lines and provide new toolbar
buttons for stepping through differences, as the following figure shows.
Folder comparisons now provides results that are sortable by name, type, size,
timestamp, or change summary. Click column headers to sort the table. Click
compare links to explore differences between files and folders. The following
example shows results sorted by Type.
When you compare subfolders with many files, now the tool continues analysis
in the background, reporting progress. You can now skip items or cancel
as you review this analysis.
44
Desktop Tools and Development Environment, MATLAB® Version 7.10 (R2010a)
For more information, see “Comparing Files and Folders”.
Editing and Debugging MATLAB Code
New features and changes introduced in Version 7.10 (R2010a) are:
• “Tab Completion for Local Variables and Functions” on page 45
• “Toolbar Buttons for Stepping Through Code Cells Without Evaluating
Code” on page 45
Tab Completion for Local Variables and Functions
The MATLAB Editor now supports tab completion for local variable and
subfunction names within MATLAB program files. For more information, see
“Completing Statements in the Editor — Tab Completion”.
Toolbar Buttons for Stepping Through Code Cells Without
Evaluating Code
This release provides two New Cell Mode toolbar buttons, Next Cell
and
Previous Cell . You can use these buttons to step through cells in the Editor
without evaluating the code within the cells. By default, these buttons do
not appear on the Cell Mode toolbar.
For more information, see “Navigating Among Code Cells in a File”.
45
Version 7.10 (R2010a) MATLAB® Software
Mathematics, MATLAB Version 7.10 (R2010a)
New features and changes introduced in this version are:
• “New Multithreading Capability” on page 46
• “Performance Improvements” on page 46
• “Changes To qr” on page 47
• “Change in Indexing for Sparse Matrix Input” on page 47
• “Improved Error Checking for Sparse Functions” on page 47
• “Computational Geometry Functions Being Changed” on page 48
• “Computational Geometry Functions Being Removed” on page 48
• “lsqnonneg No Longer Uses Optional Starting Point Input” on page 48
• “Function erfcore Removed” on page 49
• “Integer Warning Messages Removed” on page 49
• “Function intwarning Being Removed” on page 49
• “atan Warning Being Removed” on page 50
• “nextpow2 Returns Output the Same Size As Input” on page 50
• “Math Libraries Not Available to Build MEX-Files with Compaq Visual
Fortran” on page 64
New Multithreading Capability
MATLAB’s new multithreading capability now includes:
• fft for long vectors
• The two-input form of conv2
• Integer conversion and arithmetic
Performance Improvements
MATLAB features significant performance improvements for:
• Sparse matrix indexed assignment and deletion
46
Mathematics, MATLAB® Version 7.10 (R2010a)
• bvp4c and bvp5c for sparse problems
• sortrows
• mrdivide (/)
• convn
• histc
Changes To qr
The factorization routine in qr produces an upper triangular matrix, R.
Now this matrix always contains real and nonnegative diagonal elements.
In previous releases, the diagonal of R could contain complex and negative
elements.
Compatibility Considerations
R now contains only real, nonnegative diagonal elements. The QR factorization
is not unique, so the answer is still correct.
Change in Indexing for Sparse Matrix Input
Now subscripted reference into a sparse matrix always returns a sparse
matrix. In previous versions of MATLAB, using a double scalar to index into a
sparse matrix resulted in full scalar output.
Compatibility Considerations
Scalars extricated from sparse matrices are no longer full. If you previously
used the output with a function that does not support sparse input, you now
need to update your code. For a list of the functions that do not support
sparse matrices, see “Functions That Do Not Support Sparse Matrices” in the
MATLAB Mathematics documentation.
Improved Error Checking for Sparse Functions
Functions that erroneously accepted N-D arrays and returned reshaped
sparse 2-D outputs no longer accept full N-D inputs and now return an error.
The functions affected are:
• spones, spfun, sprand, sprandn, and sprandsym
47
Version 7.10 (R2010a) MATLAB® Software
• cat, horzcat, and vertcat
Also, binary functions that formerly accepted both full N-D inputs along with
sparse 2-D inputs and warned about the reshape, now return an error. For
example, ones(2,2,2).*sparse(3) formerly returned a sparse 2-by-4 matrix
along with a warning about the reshape. This code now returns an error.
Computational Geometry Functions Being Changed
The computational geometry functions delaunay, convhull, griddata,
voronoi, delaunay3, griddata3 no longer use the options arguments.
Compatibility Considerations
Use of the options arguments to delaunay, convhull, griddata, and
voronoi now throws a warning.
Computational Geometry Functions Being Removed
The functions griddata3, delaunay3, dsearch, tsearch will be removed in a
future release. Use of these functions now throws a warning.
Function Name
Use This Method Instead
griddata3
TriScatteredInterp
dsearch
DelaunayTri/nearestNeighbor
tsearch
DelaunayTri/pointLocation
delaunay3
DelaunayTri
Compatibility Considerations
Update your code to use the DelaunayTri and TriScatteredInterp
computational geometry classes .
lsqnonneg No Longer Uses Optional Starting Point
Input
The lsqnonneg solver no longer uses the optional input x0 as a starting point.
48
Mathematics, MATLAB® Version 7.10 (R2010a)
Compatibility Considerations
If you give a starting point x0, MATLAB issues a warning. Also, lsqnonneg
ignores x0, and instead uses a starting point of a vector of zeros.
Function erfcore Removed
Support for the erfcore function has been removed. Use of erfcore now
results in the following error message:
ERFCORE will be removed in a future release.
Use ERF, ERFC, ERFCX, ERFINV, or ERFCINV instead.
Compatibility Considerations
Replace erfcore with erf, erfc, erfcx, erfinv, or erfcinv. See the function
reference pages for the individual error functions.
Integer Warning Messages Removed
These warning messages for integer math and conversion have been removed:
• MATLAB:intConvertNaN
• MATLAB:intConvertNonIntVal
• MATLAB:intConvertOverflow
• MATLAB:intMathOverflow
Compatibility Considerations
The warning messages for integer math and conversion are no longer
available. Remove these warning IDs from your code.
Function intwarning Being Removed
The intwarning function will be removed in a future release. Use of
intwarning now throws a warning:
Warning: All four integer warnings are removed.
INTWARNING will be removed in a future release.
49
Version 7.10 (R2010a) MATLAB® Software
Compatibility Considerations
The warnings previously thrown when you used intwarning on are now
removed. Remove all instances of intwarning from your code.
atan Warning Being Removed
The warning thrown when you use atan(i) and atan(-i) will be removed.
Currently, the warning message is:
Warning: Singularity in ATAN. This warning will be
removed in a future release.Consider using DBSTOP
IF NANINF when debugging.
Compatibility Considerations
Remove instances of the warning ID MATLAB:atan:singularity from your
code.
nextpow2 Returns Output the Same Size As Input
In previous releases, nextpow2 with a vector input v returned
nextpow2(length(v)). Now nextpow2(v) returns a vector the same size
as the input.
Compatibility Considerations
If you require the old behavior, replace instances of nextpow2 with
nextpow2(length(v)).
Math Libraries Not Available to Build MEX-Files with
Compaq Visual Fortran
MATLAB no longer provides the libdflapack.dll and libdfblas.dll math
libraries for building Fortran MEX-files with a Compaq® Visual Fortran
compiler.
50
Mathematics, MATLAB® Version 7.10 (R2010a)
Compatibility Considerations
If you distribute MEX-files that call BLAS or LAPACK functions built
on a Compaq Visual Fortran compiler, you must also distribute the
libdflapack.dll and libdfblas.dll library files.
If MATLAB displays errors when loading a MEX-file and the Dependency
Walker indicates missing libdflapack.dll and/or libdfblas.dll
libraries, contact the MEX-file vendor for copies of the libraries. The
third-party product, Dependency Walker, is available from the Web site
http://www.dependencywalker.com/.
51
Version 7.10 (R2010a) MATLAB® Software
Data Analysis, MATLAB Version 7.10 (R2010a)
New features and changes introduced in this version are:
• “Operations on Timeseries Objects Sometimes Warn About the isTimeFirst
Property” on page 52
• “Time Series Time Vectors Can Now Contain Duplicate Sample Times”
on page 53
Operations on Timeseries Objects Sometimes Warn
About the isTimeFirst Property
In a future release, the timeseries Boolean property isTimeFirst will
behave differently. If the value is true, this property indicates that the time
vector is the first dimension of a time series. If the value is false, the time
vector is the last dimension of a time series. In this release, you receive a
warning that certain settings of isTimeFirst will not be valid in a future
release. The warning indicates that for 3-D or N-D data, time must be the last
dimension, while 2-D time series data can have time as the first dimension.
Compatibility Considerations
You can receive a warning when:
• Constructing a time series object with three or more dimensions without
specifying a time vector. In a future release, MATLAB will calculate
a value of the isTimeFirst property that can differ from the value it
currently calculates.
• Changing the data of a time series to data of a different dimensionality.
In a future release MATLAB will calculate a value of the isTimeFirst
property that differs from the value it currently calculates.
• Directly setting the isTimeFirst property for a time series to a value that
will be invalid in a future release.
The warning does not affect how you can use time series data in this release.
It is intended to inform you that the behavior of isTimeFirst will change in
a future release. If you receive a warning about isTimeFirst, you can use
the timeseries method migrateistimefirst to correct the problem. For
information type
52
Data Analysis, MATLAB® Version 7.10 (R2010a)
help timeseries/migrateistimefirst
in the Command Window.
Time Series Time Vectors Can Now Contain Duplicate
Sample Times
Starting with this release, a vector containing sample times can have
duplicate times in contiguous positions. Previously, time vectors needed to
increase monotonically and duplicated time values generated errors. This
condition is now relaxed, such that time vectors must be nondecreasing.
Interpolation of time series can produce duplicated times if the input to
the interpolation method contained duplicate time samples. For more
information, see the timeseries reference documentation.
53
Version 7.10 (R2010a) MATLAB® Software
Programming, MATLAB Version 7.10 (R2010a)
New features and changes introduced in this version are
• “Subscripting Into Function Return Values” on page 54
• “New Constructor for Map Containers” on page 55
• “Function Handle Access to Private and Protected Methods” on page 55
• “Listing Video File Formats Supported by mmreader” on page 55
• “unzip Preserves Write Attribute of Files” on page 56
• “New Package Provides Access to low-level CDF API Routines” on page 56
• “Upgrades to Scientific File Format Libraries” on page 56
• “Tiff Class Enhancements” on page 56
• “MATLAB Adds Support for Creating JPEG 2000 Files” on page 57
• “Sealed No Longer Listed as meta.property Class Property” on page 57
• “Functions and Function Elements Being Removed” on page 57
Subscripting Into Function Return Values
If you have a function, such as the following, that returns a struct array:
function structOut = getStruct
structOut = struct('fieldA', 5, 'fieldB', 10);
it is no longer valid to access fields of the structure by directly dot indexing
the function’s return value, as shown here:
getStruct.fieldA
Instead, you should first assign the returned structure to a variable, and
then dot index the variable:
s = getStruct;
s.fieldA
ans =
5
54
Programming, MATLAB® Version 7.10 (R2010a)
This type of field access has never been allowed within function code, and
this change causes scripts and command line statements to be in agreement
with function rules.
Compatibility Considerations
If you have scripts that employ this type of dot indexing, they will now throw
an error. Replace this unsupported style of dot indexing with the style shown
above.
New Constructor for Map Containers
The following command constructs an empty containers.Map object that
uses a key type of kType, and a value type of vType:
M = containers.Map('KeyType', kType, 'ValueType', vType)
See the containers.Map function reference page for more information.
Function Handle Access to Private and Protected
Methods
When creating a function handle inside a method of a class, the function
is resolved using the permissions of that method. When MATLAB invokes
the function handle, it does so using the permissions of the class. This gives
MATLAB the same access as the locations where the function handle was
created, including access to private and protected methods accessible to that
class.
See “Function Handle Access to Private and Protected Methods” on page 55
for more information.
Listing Video File Formats Supported by mmreader
The new mmreader.getFileFormats method returns a list of the formats
that mmreader supports. The list of formats is static for Windows and UNIX
systems, but dynamic on Macintosh systems. For more information, see the
getFileFormats reference page.
55
Version 7.10 (R2010a) MATLAB® Software
unzip Preserves Write Attribute of Files
In previous releases, for files archived using WinZip® software, the unzip
function set the file write attribute of extracted files to read only. Starting
with R2010a, unzip preserves the original attribute.
New Package Provides Access to low-level CDF API
Routines
MATLAB has included high-level routines for accessing Common Data
Format (CDF) files: cdfread, cdfwrite, and cdfinfo. However, the CDF API
is so large, these functions cannot satisfy every need. To solve this, MATLAB
now includes a new package, called CDFlib, that provides access to dozens
of the functions in the CDF API. Using these low-level functions, you can
create CDF files and populate them with variables and attributes using the
CDF library, version 3.3.0.
Upgrades to Scientific File Format Libraries
The following table lists upgrades to several scientific file format libraries
used by MATLAB.
Library
Version Upgrade
CDF
3.2.1 to 3.3.0
HDF5
1.8.1 to 1.8.3
HDF4
4.2.r1 to 4.2.r4
HDF-EOS2
2.8 to 2.16
PNG
1.2.8 to 1.2.39
Tiff Class Enhancements
The Tiff class includes the following enhancements.
Tiff Class Now Excludes Reading OJPEG Format Image Data
You can no longer read YCbCr OJPEG ("old-style" JPEG compression) TIFF
images. The Tiff object was not intended to work with OJPEG data but
56
Programming, MATLAB® Version 7.10 (R2010a)
some TIFF files contain data in this format. Reading this data could cause
LibTIFF to terminate.
Compatibility Considerations. To read OJPEG image data, use the imread
function. Note that the imread function transforms the image data into the
RGB colorspace.
Additional Reading and Writing Capabilities
The Tiff class includes the following additional capabilities:
• Writing image data that use 16-bit colormaps (palettes)
• Reading and writing LogL and LogLUV High Dynamic Range (HDR) images.
To write a LogL or LogLUV image, you must use the new SGILogDataFmt
property.
MATLAB Adds Support for Creating JPEG 2000 Files
You can now use the imwrite function to create a JPEG 2000 file and write
data to the file. The imwrite function supports format-specific parameters
that let you specify the mode, compression ratio, and other characteristics.
Sealed No Longer Listed as meta.property Class
Property
While class properties do not have a Sealed attribute, the meta.property
class listed Sealed as a property. Sealed is no longer listed as a
meta.property class property.
Functions and Function Elements Being Removed
Function or Function Element
Name
What
Happens
When You
Use the
Use This
Instead
Compatibility
Considerations
57
Version 7.10 (R2010a) MATLAB® Software
Function or
Element?
58
aviread
Warns
mmreader and
read
Replace all existing
instances of aviread with
mmreader and read.
aviinfo
Warns
mmreader and
get
Replace all existing
instances of aviinfo with
mmreader and get.
exifread
Warns
imfinfo
Replace all existing
instances of exifread
with imfinfo
fileparts
Still runs,
versn output is
always empty
('')
intwarning
Warns
warning
If you use intwarning,
you can implement the
same warnings using the
warning function.
isstr
Still runs
ischar
Replace all existing
instances of isstr with
ischar.
mmreader.isPlatformSupported
Warns, always
returns true
setstr
Still runs
char
Replace all existing
instances of setstr with
char.
str2mat
Still runs
char
Replace all existing
instances of str2mat with
char.
Remove all references to
a fourth output (versn)
from fileparts.
For a platform-specific
list of supported
video file formats, use
getFileFormats.
Programming, MATLAB® Version 7.10 (R2010a)
Function or Function Element
Name
What
Happens
When You
Use the
Function or
Element?
Use This
Instead
Compatibility
Considerations
strread
Still runs
textscan
Replace all existing
instances of strread with
textscan. For example,
replace
[a,b,c] = strread(...)
with
C = textscan(...)
[a,b,c] = deal(C{:})
Unlike strread, the
textscan function
converts numeric values
to the specified data type,
allowing preservation of
integer types.
strvcat
Still runs
char
Replace all existing
instances of strvcat with
char. Unlike strvcat,
the char function does not
ignore empty strings.
textread
Still runs
textscan
Replace all existing
instances of textread
with textscan, similar
to strread. Open and
close files with fopen and
fclose.
59
Version 7.10 (R2010a) MATLAB® Software
60
Use This
Instead
Compatibility
Considerations
Function or Function Element
Name
What
Happens
When You
Use the
Function or
Element?
wk1finfo
Still runs
Remove all instances
of wk1finfo. Get
information about
Excel spreadsheets with
xlsfinfo.
wk1read
Still runs
Remove all instances
of wk1read. Read
Excel spreadsheets with
xlsread.
wk1write
Still runs
Remove all instances
of wk1write. Write to
Excel spreadsheets with
xlswrite.
Graphics and 3-D Visualization, MATLAB® Version 7.10 (R2010a)
Graphics and 3-D Visualization, MATLAB Version 7.10
(R2010a)
New features and changes introduced in this version are:
Plot Selector Supports Additional Toolboxes
The Plot Selector, which was upgraded in Version 7.9 (R2009b), now also
generates plots for display functions in the following toolboxes:
• Curve Fitting Toolbox™
• Filter Design Toolbox™
• Image Processing Toolbox
• Signal Processing Toolbox™
The Plot Selector continues to support display functions for Control System
Toolbox™, Financial Toolbox™, and Statistics Toolbox™. You must have
installed a toolbox to display data using its plotting functions. For more
information about the Plot Selector, see “Enhanced Plot Selector Simplifies
Data Display” on page 98.
61
Version 7.10 (R2010a) MATLAB® Software
External Interfaces/API, MATLAB Version 7.10 (R2010a)
New features and changes introduced in this version are:
• “Changes to Compiler Support” on page 62
• “Changes to Libraries on Linux with Debian Systems” on page 64
• “Math Libraries Not Available to Build MEX-Files with Compaq Visual
Fortran” on page 64
• “Cannot Create MEX-Files with DLL File Extension” on page 64
• “-largeArrayDims Option to MEX Will Become Default in Next Release of
MATLAB” on page 65
Changes to Compiler Support
New Compiler Support
MATLAB Version 7.10 (R2010a) supports these new compilers for building
MEX-files:
Windows (32-Bit) Platforms.
• Intel C++ Version 11.1
• Intel Visual Fortran Compiler Professional Edition for Windows Version
11.1, installed with Microsoft Visual Studio 2008 Shell. This product is
bundled.
• Intel Visual Fortran Compiler Professional Edition for Windows Version
11.1 and Microsoft Visual Studio 2008 SP1 Professional Edition. Separate
products.
• Open Watcom Version 1.8
Windows (64-Bit) Platforms.
• Intel C++ Version 11.1
• Intel Visual Fortran Compiler Professional Edition for Windows Version
11.1, installed with Microsoft Visual Studio 2008 Shell. This product is
bundled.
62
External Interfaces/API, MATLAB® Version 7.10 (R2010a)
• Intel Visual Fortran Compiler Professional Edition for Windows Version
11.1 and Microsoft Visual Studio 2008 SP1 Professional Edition. Separate
products.
Compiler Support to Be Phased Out
Support for the following compilers will be discontinued in a future release, at
which time new versions will be supported. For an up-to-date list of supported
compilers, see the Supported and Compatible Compilers Web page.
Windows (32-Bit) Platforms.
• Intel Visual Fortran Version 10.1
• Intel C++ Version 9.1
Windows (64-Bit) Platforms.
• Intel Visual Fortran Version 10.1
• Intel C++ Version 9.1
Discontinued Compiler Support
MATLAB no longer supports the following compilers:
Windows (32-Bit) Platforms.
• Open Watcom Version 1.7
• Microsoft Visual Studio .NET 2003 Version 7.1
Solaris™ SPARC® (64-Bit) Platforms.
• Sun™ Studio 11 cc / CC Version 5.8
• Sun Studio 11 f90 Version 8.2
Compatibility Considerations. To ensure continued support for building
your MEX-files, consider upgrading to another supported compiler. For an
up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
63
Version 7.10 (R2010a) MATLAB® Software
Changes to Libraries on Linux with Debian Systems
If you run MATLAB Version 7.10 (R2010a) on a Linux with Debian® system,
you must use Debian 5, as indicated on the Platforms & Requirements Web
page.
MEX-files created with MATLAB Version 7.2 (R2006a) or earlier depend on
the libstdc++.so.5 library. Debian 5 does not include this library. MATLAB
running on Linux platforms with Debian 5 cannot load these pre-R2006a
MEX-files.
Compatibility Considerations
You cannot run MEX-files created with MATLAB R2006a or earlier on Linux
with Debian 5. Recompile these files on a system with Debian 5.
Math Libraries Not Available to Build MEX-Files with
Compaq Visual Fortran
MATLAB no longer provides the libdflapack.dll and libdfblas.dll math
libraries for building Fortran MEX-files with a Compaq Visual Fortran
compiler.
Compatibility Considerations
If you distribute MEX-files that call BLAS or LAPACK functions built
on a Compaq Visual Fortran compiler, you must also distribute the
libdflapack.dll and libdfblas.dll library files.
If MATLAB displays errors when loading a MEX-file and the Dependency
Walker indicates missing libdflapack.dll and/or libdfblas.dll
libraries, contact the MEX-file vendor for copies of the libraries. The
third-party product, Dependency Walker, is available from the Web site
http://www.dependencywalker.com/.
Cannot Create MEX-Files with DLL File Extension
On Windows 32-bit platforms, support for MEX-files with a .dll file extension
is being phased out. Use the .mexw32 extension instead.
64
External Interfaces/API, MATLAB® Version 7.10 (R2010a)
MATLAB Version 7.10 will continue to execute .dll MEX-files, but future
versions of MATLAB will not support the .dll extension. You can no
longer use the mex function -output switch to create MEX-files with a .dll
extension. If you enter a command such as:
mex myfile.c -output newfile.dll
MATLAB creates the MEX-file newfile.mexw32 and displays a warning
message.
For more information about MEX-files with .dll extensions, see “Running
MEX-Files with .DLL File Extensions on Windows 32-bit Platforms”.
Compatibility Considerations
Recompile MEX-files with .dll file extensions. Update MATLAB scripts or
makefiles that explicitly specify .dll extensions for compiled MEX-files.
If you use MEX-files with a .dll extension from a third-party source, contact
that vendor to get a recompiled version, referring to these release notes.
-largeArrayDims Option to MEX Will Become Default
in Next Release of MATLAB
In the next release of MATLAB, the default mex command will change to
use the large-array-handling API. This means the -largeArrayDims option
will become the default.
You do not need to make changes to build and run MEX-files with MATLAB
Version 7.10 (R2010a).
Compatibility Considerations
Source for MEX-files built on 64-bit platforms must be updated in order to
successfully build and run with the next release of MATLAB. Review your
source MEX-files and mex build scripts. For information about migrating your
MEX-files to use the large-array-handling API, “Upgrading MEX-Files to
Use 64-Bit API”.
65
Version 7.9.1 (R2009bSP1)
MATLAB Software
This table summarizes what’s new in Version 7.9.1 (R2009bSP1).
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
No
Bug Reports
Includes fixes
No
New features and changes introduced in this version are as follows:
The version number of the MATLAB® Compiler™ Runtime (MCR) in release
R2009bSP1 is different from the MCR version number in release R2009b. For
details about MCR version numbers and corresponding MATLAB releases, see
http://www.mathworks.com/support/solutions/en/data/1-4GSNCF/?solution=1-4GS
67
Version 7.9 (R2009b)
MATLAB Software
This table summarizes what’s new in Version 7.9 (R2009b).
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized under
these topics:
• “Desktop Tools and Development Environment, MATLAB Version 7.9
(R2009b)” on page 71
• “Mathematics, MATLAB Version 7.9 (R2009b)” on page 86
• “Data Analysis, MATLAB Version 7.9 (R2009b)” on page 89
• “Programming, MATLAB Version 7.9 (R2009b)” on page 90
• “Graphics and 3-D Visualization, MATLAB Version 7.9 (R2009b)” on page
98
69
Version 7.9 (R2009b) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.9
(R2009b)” on page 103
• “External Interfaces/API, MATLAB Version 7.9 (R2009b)” on page 105
70
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
Desktop Tools and Development Environment, MATLAB
Version 7.9 (R2009b)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 71
• “Desktop” on page 72
• “Help Browser” on page 74
• “Workspace and Variable Editor” on page 79
• “Managing Files” on page 79
• “File Exchange Desktop Tool — Find and Get Files Created by Other
Users” on page 82
• “Editing and Debugging MATLAB Code Files” on page 83
• “Publishing MATLAB Code Files to PDF Output Format” on page 84
• “Internationalization” on page 84
Startup and Shutdown
Changes to -nodisplay and -noFigureWindows Startup Options
When you start MATLAB using -nodisplay (UNIX) or -noFigureWindows
(Microsoft Windows) startup options, running a built-in GUI (predefined
dialog boxes) generates this warning:
This functionality is no longer supported under
the nodisplay and -noFigureWindows startup options.
If the GUI is modal, MATLAB execution suspends, and you need to type
Ctrl+C for the Command Window prompt to reappear.
This change affects predefined dialog boxes, such as dialog, msgbox,
printpreview, uigetfile, uisetcolor, waitfor, waitbar, and more.
For a list of predefined dialog boxes, see Predefined Dialog Boxes. For
more information on startup options, see the matlab (UNIX) and matlab
(Windows) reference pages, respectively.
71
Version 7.9 (R2009b) MATLAB® Software
In a future release, instead of a warning, MATLAB will generate an error
when you use such a dialog box under the -nodisplay or -noFigureWindows
options.
Compatibility Considerations. To avoid generating the warning, start
MATLAB without the -nodisplay or -noFigureWindows startup options. To
avoid warnings while continuing to use these startup options, remove the code
that is now producing the warnings.
Changes to Memory Manager Startup Options
Version 7.9 removes support for the -memmgr and -check_malloc command
line arguments and the MATLAB_MEM_MGR environment variable.
Compatibility Considerations. MATLAB ignores any memory manager
options.
Desktop
New features and changes introduced in Version 7.9 (R2009b) are:
• “Ability to Customize Keyboard Shortcuts” on page 72
• “Ability to Set Fonts Preferences for Extended M-Lint Messages and
Function Browser” on page 74
• “Save Files from MATLAB Web Browser” on page 74
Ability to Customize Keyboard Shortcuts
MATLAB supports customizing keyboard shortcuts for desktop tools. Press
combinations of keyboard keys to perform a desktop action, instead of using
the mouse to select items from menus. For example, press Ctrl+N to open a
blank file in the Editor.
The ability to customize keyboard shortcuts enables you to:
• Modify keyboard shortcuts across desktop tools on an action-by-action basis.
• Modify keyboard shortcuts to match other applications you use or to match
your personal preferences.
72
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
• Share your keyboard shortcuts with others, or use shortcuts created by
someone else.
• Create keyboard shortcuts for some actions that currently have no shortcut.
• Use your preferred keyboard shortcuts when you use MATLAB on a
different system than you typically use.
To customize keyboard shortcuts, choose
File > Preferences > Keyboard > Shortcuts.
MATLAB does not support customizing keyboard shortcuts for Figure
Windows, dialog boxes, or toolboxes. For details, see “Customizing Keyboard
Shortcuts”. For a video demo, see Customizable Keyboard Shortcuts.
Compatibility Considerations.
• The method for specifying keyboard shortcuts differs from previous
versions.
In previous versions, you chose File > Preferences > Keyboard, and
then chose a set of key bindings. MATLAB no longer limits your choices to
either platform-specific settings or Emacs settings.
• Some default keyboard shortcuts differ from the previous defaults.
Defaults changed in Version 7.9 (R2009b) to be more consistent across
the MATLAB desktop. Previously, you could specify keyboard shortcut
preferences for the Command Window and Editor/Debugger only. For
instance, on Windows, default keyboard shortcut preferences appeared as
follows:
To restore keyboard shortcuts that were the default before Version 7.9
(R2009b):
1 Choose File > Preferences > Keyboard > Shortcuts.
73
Version 7.9 (R2009b) MATLAB® Software
2 From the Active settings drop-down menu, choose R2009a Windows
Default Set, R2009a Macintosh Default Set, or R2009a UNIX
Default Set, depending on the platform on which MATLAB is installed.
Ability to Set Fonts Preferences for Extended M-Lint Messages
and Function Browser
MATLAB now supports setting the font size and type for extended M-Lint
messages and the function browser. In previous releases, changes to HTML
Proportional Text affected only the display in the MATLAB Web browser,
the Profiler, and Help topics. To set font preferences:
1 Choose File > Preferences > Fonts > Custom.
2 Under Desktop tools, select HTML Proportional Text, and then specify
the font size and type you want to use.
For more information, see “Custom Fonts Preferences”.
Save Files from MATLAB Web Browser
To save a file being displayed in the MATLAB Web Browser, select
File > Save As.
Help Browser
For a demonstration of enhancements to the Help browser, watch the Help
Browser Enhancements video.
Improved Contents Listing
When you expand a product in the Contents pane, you now can view the
following:
• Function and block names with brief descriptions — Expand Functions or
Blocks, and then expand a category to see the list and descriptions. Select
a function or block to view its reference page.
If you provide your own HTML help files for use in the Help browser, you
now can include Functions and Blocks entries for your toolbox.
74
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
• Demos — Expand Demos, and then select a demo from the list to view
or run it.
Enhanced Presentation of Search Results
Each search result includes:
• A preview of where the search words were found within the page.
• An icon representing the type of document, such as a reference page or
demo.
Use new sorting and grouping features to arrange results:
• Sort results by Relevance, in addition to sorting by Type and Product,
which were available in previous versions.
75
Version 7.9 (R2009b) MATLAB® Software
• After sorting by Type or Product, you now can collapse and expand results
for each type or product. To expand or collapse all groups, right-click in the
results pane and select the option you want from the context menu.
The following example of Search Results in the Help browser illustrates
grouping, previews, and the block reference page icon.
Viewing Pages
• To see where the current page is located within the documentation, use the
navigation bar at the top of the display pane. To go to another topic in the
documentation, select an entry from the navigation bar.
76
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
• Use the new Actions button
on the display pane toolbar to access
features such as Refresh, which clears the search results highlighting for
the current page.
• Get links to reference pages for overloaded functions. When you run doc
foo, if foo is an overloaded function, a message appears at the top of the
display pane that provides links to the other foo reference pages.
• To use the Help browser alongside other tools, dock it in the desktop. When
docked in a narrow area of the desktop, the pane for Contents and Search
Results moves above the display pane.
77
Version 7.9 (R2009b) MATLAB® Software
Compatibility Considerations
The Index and Demos tabs are no longer in the Help browser:
• To find terms that were in the Index, use the search feature instead.
• To access demos for a product, go to the Contents pane and expand the
Demos entry for the product.
78
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
The Actions button on the toolbar provides access to features for the displayed
page. Previously, some of these features were available on individual toolbar
buttons. To add individual toolbar buttons, right-click the toolbar and select
Customize.
If you provide your own files for use in the Help browser:
• Remove the helpindex.xml entry from the info.xml file for your toolbox.
MATLAB no longer supports the Index.
• Demos you add now appear in the Contents pane under Other Demos,
which is after the entries for all MathWorks products.
For more information about the new Help browser features, see “Getting
Help and Product Information”.
Workspace and Variable Editor
Improved Workspace Plotting Tool
The Plot Selector button on
the Workspace Browser and
Variable Editor toolbars has a new look and added capabilities, options,
and help. The tool now displays larger icons, includes many more graphing
functions, summarizes each function, and displays pop-up windows with
syntax descriptions (function hints). You can customize the tool by
rearranging and categorizing functions, and by creating a list of “favorites”.
For further details, see this video demo and the release note “Enhanced Plot
Selector Simplifies Data Display” on page 98.
Managing Files
Enhanced Current Folder (Directory) Browser
The Current Directory browser is now the Current Folder browser.
For an overview of the enhancements, watch this video, Current Folder
Browser Enhancements, or review the following summary:
79
Version 7.9 (R2009b) MATLAB® Software
• Use the expandable tree structure to view the contents of the current
folder. Double-click a subfolder to make it the current folder.
• Display the file type in a column.
• Distinguish types of MATLAB program files using new icons:
-
class
function
script
• View file descriptions below file names. To show or hide descriptions, select
View > Show > Description.
• Display hidden files a new way:
-
On Windows platforms, MATLAB follows your Windows preference for
hidden files.
-
On other platforms, MATLAB uses the new setting in Current Folder
preferences.
• Find files and folders within the current folder and its subfolders:
-
To access the search feature, click the Search button
bar, and then enter the string you want to find.
-
To clear the results and display all files and folders in the current folder,
click the Clear button .
on the address
The following illustration shows the new Current Folder browser, including
the tree view, new icons for program files, and the search button.
80
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
Compatibility Considerations.
• With the new tree structure, you now see all files, including those in
subfolders. You might not be able to run the files you see in the subfolders.
To run a file from a subfolder, the subfolder must be on the search path
or the subfolder must become the current folder. In previous versions,
you could only see files in the current folder, so you could run every file
you could see.
81
Version 7.9 (R2009b) MATLAB® Software
• You now search for files by clicking the search button in the address bar.
In previous versions, the search feature, referred to as the filter field,
appeared if your preference was set to display it.
• File descriptions now appear below the file name. In previous versions,
they displayed in a column.
For more information about the new features, see “Managing Files in
MATLAB”.
File Exchange Desktop Tool — Find and Get Files
Created by Other Users
Watch this video, MATLAB File Exchange Access, or review the following
summary of what you can do with the new File Exchange desktop tool:
• Access user-created files from the File Exchange repository. The files are at
MATLAB Central, the community area of the MathWorks Web site.
• Use the files in your own work to save time and get new ideas.
• Work with the file repository from within the MATLAB desktop.
• Use features like those found in the Web site interface to the File Exchange
repository.
The File Exchange desktop tool offers these main features:
• Find files by searching and by selecting tags (keywords associated with
files).
• Sort results. For example, show the most highly rated or the most recent
files first.
• View details about a file.
• Download files to use in MATLAB.
• Provide feedback about files.
To open the File Exchange tool, select Desktop > File Exchange.
82
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
If you have questions while you work, access the File Exchange FAQ by
clicking the Help button . For full documentation, see “File Exchange —
Finding and Getting Files Created by Other Users”.
Editing and Debugging MATLAB Code Files
New features and changes introduced in Version 7.9 (R2009b) are:
• “Syntax Highlighting for VHDL and Verilog Code” on page 84
83
Version 7.9 (R2009b) MATLAB® Software
• “File and Folders Comparison Tool Enhanced” on page 84
Syntax Highlighting for VHDL and Verilog Code
The MATLAB Editor now supports syntax highlighting for VHDL and Verilog
code. For details see, “Setting VHDL Language Preferences” and “Setting
Verilog Language Preferences”.
File and Folders Comparison Tool Enhanced
When you use the File and Folders Comparisons tool to compare folders, it
now includes the following information about each file in each folder:
• The file size, in bytes
• The date the file was last modified
In addition, the File and Folders Comparisons tool enables you to reload the
information by clicking the refresh button
or selecting File > Refresh. For
details see, “Comparing Files and Folders”.
Publishing MATLAB Code Files to PDF Output Format
MATLAB now supports PDF as the output format for publishing MATLAB
code files. For instructions on how to publish to .pdf files, watch the
Publishing Features video demo. For details, see “Steps for Publishing
sine_wave_f.m to PDF”.
Internationalization
How MATLAB Reads Customized Locale Settings on Macintosh
OS X Platforms
If you use the Customize option to modify the locale setting, MATLAB
ignores the customized portion. For example, if you select the euro currency
symbol for a locale set to the United Kingdom, the locale name is:
[email protected]=EUR
MATLAB uses the locale name:
84
Desktop Tools and Development Environment, MATLAB® Version 7.9 (R2009b)
en_GB
85
Version 7.9 (R2009b) MATLAB® Software
Mathematics, MATLAB Version 7.9 (R2009b)
New features and changes introduced in this version are:
• “Computational Geometry Functions Being Changed” on page 86
• “Computational Geometry Functions Being Removed” on page 86
• “New Sparse Matrix Functionality In qr and mldivide Functions” on page 87
• “Support for Large-Sized Dimensions In fft” on page 87
• “Performance Improvement For Large Data Sets” on page 87
• “erfcore Being Removed” on page 87
• “New Multithreading Capability” on page 88
• “New Test Matrices in gallery Function” on page 88
Computational Geometry Functions Being Changed
2- and 3-D computational geometry functions (delaunay, convhull, griddata,
voronoi, delaunay3, griddata3) no longer use QHULL or the QHULL
options arguments. The N-D functions gridatan, delaunayn, convhulln, and
voronoin still use QHULL.
Compatibility Considerations
The QHULL options arguments to delaunay, convhull, griddata, and
voronoi are no longer required and are currently ignored. Support for these
options will be removed in a future release.
Computational Geometry Functions Being Removed
A future release will remove the griddata3, dsearch, tsearch, and
delaunay3 functions. See the table below for alternatives.
86
Function Name
Use This Method Instead
griddata3
TriScatteredInterp
dsearch
DelaunayTri/nearestNeighbor
Mathematics, MATLAB® Version 7.9 (R2009b)
Function Name
Use This Method Instead
tsearch
DelaunayTri/pointLocation
delaunay3
DelaunayTri
Compatibility Considerations
Update your old code to use the new computational geometry classes
DelaunayTri and TriScatteredInterp.
New Sparse Matrix Functionality In qr and mldivide
Functions
mldivide supports complex rectangular sparse input matrices. qr supports
complex sparse input matrices. qr for sparse matrix input now supports a
third output argument that contains a fill-reducing permutation.
Support for Large-Sized Dimensions In fft
MATLAB functions fft, fft2, and fftn (and their inverses ifft, ifft2,
and ifftn) can now handle input arrays with a size in 1 dimension greater
than 231 − 1 on 64-bit platforms.
Performance Improvement For Large Data Sets
• MATLAB includes improved sparse matrix performance for indexing, basic
math, binary and relational operators, and exponential functions.
• There are significant performance improvements to conv2.
erfcore Being Removed
Use of erfcore will produce a warning:
ERFCORE will be removed in a future release.
Use ERF, ERFC, ERFCX, ERFINV, or ERFCINV instead.
Compatibility Considerations
Replace all instances of erfcore with erf, erfc, erfcx, erfinv, or erfcinv.
87
Version 7.9 (R2009b) MATLAB® Software
New Multithreading Capability
Many MATLAB functions are now multithreaded:
• sort
• bsxfun
• mldivide for sparse rectangular matrix input
• qr for sparse matrix input
• filter for matrices and higher-dimensional arrays
• gamma, gammaln
• erf, erfc, erfcx, erfinv, erfcinv
New Test Matrices in gallery Function
The gallery suite of test matrices includes new options integerdata,
normaldata, and uniformdata.
88
Data Analysis, MATLAB® Version 7.9 (R2009b)
Data Analysis, MATLAB Version 7.9 (R2009b)
New features and changes introduced in this version are:
Improved Plot Selector Makes Graphic Data
Exploration Easier
The Plot Selector button on the Workspace Browser and Variable Editor
toolbars has a new look and added capabilities, options, and help. Now the
Plot Selector button
changes its appearance to reflect the
variable or variables you select. Now it suggests a plot type and indicates
its calling argument sequence. You can also make the Plot Selector list the
types of graphs you use most often at the top of its drop-down menu. The tool
provides descriptions and hints to help you discover data graphing functions
and learn to use them more effectively.
For further details, see this video demo and the release note “Enhanced Plot
Selector Simplifies Data Display” on page 98.
89
Version 7.9 (R2009b) MATLAB® Software
Programming, MATLAB Version 7.9 (R2009b)
New features and changes introduced in this version are
• “Ignore Selected Arguments on Function Calls” on page 90
• “Internal Packages Make Reserved Functions Easy to Identify” on page 91
• “Use of lasterror, lasterr, rethrow(errStruct) Not Recommended” on page 92
• “Use of maxNumCompThreads No Longer Recommended” on page 93
• “Excel Worksheet Selection in the Import Wizard” on page 93
• “Motion JPEG 2000 Files Supported by mmreader” on page 93
• “Minimum Sample Rate for audioplayer” on page 94
• “Documentation Changes: File I/O and Data Import and Export” on page 94
• “Object Array Property Indexing” on page 94
• “Equality of Objects Using isequal Now Ignores Numeric Class” on page 95
• “Class Defining Private/Abstract Property Now Errors” on page 95
• “Subclasses of Built-in Classes and numel” on page 95
• “Array Expansion with Indexed Assignment” on page 95
• “New Tiff Object Enables Writing of Tiled Data and Broader Metadata
Support” on page 96
• “Ambiguity Error Now Reported” on page 96
Ignore Selected Arguments on Function Calls
This version of MATLAB introduces a new usage for the tilde (~) operator.
As in earlier releases, tilde signifies a logical NOT. In the 9b release, you
can also use the tilde operator to specify unused outputs in a function call,
or unused inputs in a function definition. See “Ignoring Selected Outputs or
Input Arguments” in the Programming Fundamentals documentation for
more information on this feature.
Replacing Output Variables with Tilde
This feature enables you to replace this type of function call:
90
Programming, MATLAB® Version 7.9 (R2009b)
[val1, ignoreThisOutput, val3] = myTestFun;
with the following:
[val1, ~, val3] = myTestFun;
MATLAB ignores any values returned by a function that have a corresponding
tilde in the output list. This new syntax can help you avoid confusion in your
program code and unnecessary clutter in your workspace. It also avoids
wasting memory to store unused outputs returned from the called function.
Replacing Input Arguments with Tilde
You can also use the tilde operator to specify unused inputs when you are
creating a function. You can replace this type of function definition:
function myTestFun(arg1, ignoreThisInput, arg3)
with the following
function myTestFun(arg1, ~, arg)
Whenever this function is called, MATLAB ignores any inputs passed to the
function that have a tilde in the corresponding position in the input argument
list. You are likely to find the tilde operator most useful when writing
callback functions and subclass methods that must match a predefined
function interface.
Internal Packages Make Reserved Functions Easy
to Identify
The MathWorks® reserves the use of packages named internal for utility
functions used by internal MATLAB code. Functions that belong to an
internal package are intended for The MathWorks use only. Using functions
that belong to an internal package is strongly discouraged. These functions
are not guaranteed to work in a consistent manner from one release to the
next. In fact, any of these functions and classes may be removed from the
MATLAB software in any subsequent release without notice and without
documentation in the product release notes.
91
Version 7.9 (R2009b) MATLAB® Software
See “Internal Utility Functions” in the Programming Fundamentals
documentation for more information.
Use of lasterror, lasterr, rethrow(errStruct) Not
Recommended
In version 7.5, The MathWorks introduced a new class called MException for
use in error handling. Prior to this change, the lasterr and, more recently,
lasterror functions kept track of only the one most recently thrown error.
The state of any errors thrown before that was overwritten by newer errors.
Also, this error state was globally accessible, which means that it could be
unintentionally modified or destroyed either during an interactive session or
by another function.
When using the newer, object-based error mechanism, every error generated
by a MATLAB function stores information about what caused the error in a
separate MException object. This enables MATLAB to store information
about multiple errors, adds the capacity to store new fields of information
including links to related errors, and also resolves the problem of being
globally accessible.
The MathWorks now discourages the use of the lasterr and lasterror
functions because the information they return is global and thus has the
potential to be corrupted. You should replace the use of these two functions
with the new style of try-catch statement that captures an MException
object to represent the error. When entering commands at the MATLAB
command line, you can also use the static method Mexception.last to
retrieve information on the most recent error. For more information on this
method of error handling, see “The MException Class”.
This change also affects which form of the rethrow function to use when
reissuing an exception. The original rethrow function, in use since before
version 7.5, accepts only a structure as input. Because this structure is
typically obtained using the lasterror function, this form of rethrow should
be avoided. The later form of rethrow(MException), introduced in version
7.5, accepts an MException object as input, and is the recommended form.
92
Programming, MATLAB® Version 7.9 (R2009b)
Compatibility Considerations
It is strongly recommended that you discontinue the use of lasterror and
lasterr, and that you replace the use of these functions in your program code
with the MException-based style of error handling described above.
Use of maxNumCompThreads No Longer
Recommended
Invoking the function maxNumCompThreads now returns the following warning:
Warning: maxNumCompThreads will be removed in a future release.
Please remove any instances of this function from your code.
maxNumCompThreads continues to operate the same in this release of MATLAB.
However, the function will be discontinued in a future release of the product.
Compatibility Considerations
It is recommended that you discontinue the use of maxNumCompThreads.
However, if you do have any program code that invokes this function, you
should make sure that such programs are not affected by this new warning.
Excel Worksheet Selection in the Import Wizard
In previous releases, the Import Wizard imported only the first populated
worksheet in an Excel file. The Import Wizard now allows you to specify the
worksheet to import. To start the Import Wizard, use one of the following
methods:
• Select File > Import Data.
• Call uiimport.
• Double-click a file name in the Current Folder browser.
Motion JPEG 2000 Files Supported by mmreader
mmreader now imports Motion JPEG 2000 (.mj2) files on Windows, Macintosh,
and Linux platforms.
93
Version 7.9 (R2009b) MATLAB® Software
Compatibility Considerations
Because mmreader imports Motion JPEG 2000 files, the function
mmreader.isPlatformSupported always returns true on Windows,
Macintosh, and Linux platforms. For a list of file formats that mmreader
supports, and the requirements to read these formats on each platform, see
the mmreader reference page.
Minimum Sample Rate for audioplayer
If you specify a sample rate less than 80 samples per second, audioplayer
generates an error with the following ID:
MATLAB:audioplayer:positivesamplerate
Compatibility Considerations
In previous releases, the error ID on Windows platforms for low sample rates
was:
MATLAB:audioplayer:negativesamplerate
Change any references to this identifier to:
MATLAB:audioplayer:positivesamplerate
Documentation Changes: File I/O and Data Import
and Export
The function category “File I/O” is renamed “Data Import and Export.” It
appears immediately below the category “Desktop Tools and Development
Environment.”
In the MATLAB User Guide, Data Import and Export content previously
appeared in the Programming Fundamentals documentation. The User Guide
now includes a stand-alone topic for Data Import and Export.
Object Array Property Indexing
Object array indexing operations on properties now return an error for
improper array references. Before MATLAB 7.9, an expression such as:
obj.Prop(n) % for non-scalar obj is invalid if Prop is a property
94
Programming, MATLAB® Version 7.9 (R2009b)
did not return an error. MATLAB 7.9, you can reference or assign properties
from scalar objects only by entering:
obj(int).Prop(n)
where int is a positive integer.
Equality of Objects Using isequal Now Ignores
Numeric Class
Before MATLAB 7.9, an expression such as:
isequal(a,b)
returned false in cases where a and b are objects of the same class that have
properties set to numeric values which are mathematically equivalent, but of
different classes (for example, double and single),
The behavior of isequal in MATLAB 7.9 is consistent with the documented
behavior (see isequal). isequal does not consider class when comparing
numeric values.
Class Defining Private/Abstract Property Now Errors
MATLAB 7.9 returns an error when it loads a class that defines a property as
both Abstract and Private.
Subclasses of Built-in Classes and numel
Before MATLAB 7.9, the numel function did not return the same results
for built-in classes and subclasses of built-in classes. In MATLAB 7.9, the
behavior of numel is consistent with built-in classes and subclasses of built-in
classes. See “Understanding size and numel” for a discussion of the current
behavior.
Array Expansion with Indexed Assignment
Before MATLAB 7.9, initializing a handle object array by specifying the last
element in the array to create it:
obj(10) = MyClass;
95
Version 7.9 (R2009b) MATLAB® Software
resulted in the same handle being assigned from the second to the penultimate
elements of the array. With MATLAB 7.9, all elements in the handle
object array have unique handles. See “Creating Object Arrays” for more
information on the current behavior.
New Tiff Object Enables Writing of Tiled Data and
Broader Metadata Support
Using the new Tiff object, you can now write portions of a TIFF file and
update the values of individual metadata tags in an image. MATLAB has long
offered the capability of reading and writing TIFF files, using the imread and
imwrite functions. However, if you wanted to update any part of the image,
you had to write the entire image to the file. Similarly, if you just wanted
to update a tag, you had to write the entire image. By providing access to
functions in the LibTIFF library, the Tiff object offers more flexibility in
creating and editing TIFF images. You can write data to specific tiles in an
image and update individual tags in a file, without having to write the entire
image.
Ambiguity Error Now Reported
Due to a bug, versions of MATLAB prior to Version 7.9 did not report an error
in functions such as the following, even though it cannot be determined in
the last line whether U is a variable or a function:
function r = testMfile1(A)
A = 1;
eval('U = 1;');
r = A(logical(end), U(end));
However, if you replace the last line with
r = A(U(end));
MATLAB reports an ambiguity error and has done so since Version 7.0.
Starting in Version 7.9, MATLAB reports an ambiguity error for either
statement.
96
Programming, MATLAB® Version 7.9 (R2009b)
Compatibility Considerations
In certain circumstances, it is possible that you will see ambiguity errors
generated in code that did not report this error in previous releases. If you do
get such an error, examine your code and resolve the ambiguous statements.
97
Version 7.9 (R2009b) MATLAB® Software
Graphics and 3-D Visualization, MATLAB Version 7.9
(R2009b)
New features and changes introduced in this version are:
• “Enhanced Plot Selector Simplifies Data Display” on page 98
• “Certain Print Options and Devices Now Warn When Used” on page 101
• “The view Function No Longer Supports 4-by-4 Transformation Matrices
as Input” on page 102
Enhanced Plot Selector Simplifies Data Display
The Plot Selector workspace tool creates graphs of workspace variables. As
this video demo shows, the tool lets you access more types of data display
functions and provides help about each one. It also categorizes display
functions and lets you organize them within its drop-down menu. The
following illustration shows the old and new versions of the Plot Selector
and calls out new features.
98
Graphics and 3-D Visualization, MATLAB® Version 7.9 (R2009b)
Plot Selector in R2009b
Tabbed lists
of plot types
Tear off
window
Syntax Help
Link to
reference
page
Switch x/y
variables
Text search in GUI
Dragable menu item
Plot Selector before R2009b
Plot category
Create favorite
Link to Plot Catalog
Use the Plot Selector tool to instantly generate graphs of workspace variables.
You can choose from more than 40 two-dimensional, three-dimensional, and
volumetric MATLAB data display types. It also constructs graphs using
Control System Toolbox, Financial Toolbox, and Statistics Toolbox functions if
your installation includes those products.
The Plot Selector button
displays a graph icon and the names
of selected variables in the Workspace browser or the Variable Editor. Until
you select one or more variables, the button reads Select to plot
.
99
Version 7.9 (R2009b) MATLAB® Software
The graphing function for one or two data vectors still defaults to plot, but the
tool now gives you additional options and information, including the following:
• The grouping of menu items into categories of graph types, such as Stem
and Stair Plots, 3-D Surface Plots, and Analytic Plots. You can
rearrange categories and items within a category by dragging them.
• A Favorites category at the top of the menu, where you can collect the
types of graphs you use most often. Your collection of favorites persists
across MATLAB sessions.
• A star-shaped button
on menu items that adds a graph type to or
removes one from your Favorites collection.
• Two tabs
for toggling the scope of the menu:
-
Plots for <variable names> — The set of graphs you can generate
with the currently selected variables
-
All plots — A master list of graphing functions available on your system
On the All plots tab, graphing functions that are not compatible with the
selected variables display in gray and do not plot. Incompatible plot types
do not appear on the first-tab menu.
• A button
to interchange the axes positions of two selected variables
• Pop-up descriptions of function syntax when your mouse pointer lingers
over a menu item
• Direct access to your Favorites from context menus in the Workspace
Browser and the Variable Editor
For more information, see “Creating Plots from the Workspace Browser”.
Compatibility Considerations
• In previous versions, the Plot Selector automatically assigned variables
named t and time to the x-axis. Now, the variable you select first always
to
plots on the x- axis. Use the switch variable input order button
interchange the x and y variables before plotting them.
100
Graphics and 3-D Visualization, MATLAB® Version 7.9 (R2009b)
• In previous versions, clicking Plot Selector > More Plots opened the Plot
Catalog tool. Now, you click Catalog at the bottom of the Plot Selector GUI
to open the Plot Catalog tool. The Plot Catalog has not changed.
Certain Print Options and Devices Now Warn When
Used
The following print command option and device now throw warnings when
used and will be removed in a future release:
Option/
Device
Warning ID
Warning Text
'-adobecset' 'MATLAB:print:
print option adobecset:DeprecatedOption'
The -adobecset option
will be removed in a
future release.
’-dill'
print device
(native
support
for Adobe
Illustrator)
The ’-dill' print device
will be removed in
a future release.
Use Encapsulated
PostScript ('-depsc')
instead.
'MATLAB:print:
Illustrator:DeprecatedDevice'
If you wish to prevent these warnings from displaying, use the warning
command.
• To disable the warning generated by using the adobecset print option:
warning('off', 'MATLAB:print:adobecset:DeprecatedOption');
• To disable the warning generated by using the dill print device:
warning('off', 'MATLAB:print:Illustrator:DeprecatedDevice');
Compatibility Considerations
If you have developed code that uses the previous option or device, in the
future you must remove such calls or replace them with other code.
101
Version 7.9 (R2009b) MATLAB® Software
The view Function No Longer Supports 4-by-4
Transformation Matrices as Input
The view function. no longer supports 4-by-4 transformation matrices as
input arguments. Previously, you could create a 4-by-4 transformation matrix
and use it with view.
Compatibility Considerations
If you have code that calls view(T), explore using view([az el]) instead.
102
Creating Graphical User Interfaces (GUIs), MATLAB® Version 7.9 (R2009b)
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.9 (R2009b)
New features and changes introduced in this version are:
• “Expanded Documentation on Techniques for Programmatic GUI Design”
on page 103
• “Previous Change to How UI Components Set the Figure SelectionType
Property ” on page 103
Expanded Documentation on Techniques for
Programmatic GUI Design
The section “Laying Out a Programmatic GUI” of the Creating Graphic User
Interfaces documentation has been expanded. The updated section, formerly
called “Aligning Components,” now has the title “Composing and Coding GUIs
with Interactive Tools”.
The renamed section describes techniques, functions, and predefined dialog
boxes you can use to accelerate programmatic construction of GUIs (that is,
those you create without using GUIDE).
The section includes examples of setting component positions, colors, and font
properties interactively. Also included is an example function that generates
a set statement for a specified property of any GUI component. By running
this function and pasting its output into your GUI code file, you can save time
and avoid making typographical errors.
Previous Change to How UI Components Set the
Figure SelectionType Property
The MATLAB SelectionType figure property had an undocumented change
in V. 7.6 (R2008a). That change modified how the property is set in response
to single-clicking and double-clicking objects, particularly uicontrols, with
and without key modifiers.
For information about this change, including potential incompatibilities, see
“Changes to How uicontrols Set Figure SelectionType” on page 237. The
103
Version 7.9 (R2009b) MATLAB® Software
table in that release note specifies the SelectionType setting resulting from
clicking a UI component in both enabled and disabled states.
104
External Interfaces/API, MATLAB® Version 7.9 (R2009b)
External Interfaces/API, MATLAB Version 7.9 (R2009b)
New features and changes introduced in this version are:
• “Changes to Compiler Support” on page 105
• “Run-Time Libraries Required for Applications Built with Microsoft® Visual
Studio 2008 Compiler” on page 106
• “Changes to Building MEX-Files” on page 107
• “New Features for Interface to Microsoft .NET Framework” on page 107
Changes to Compiler Support
Support for Apple Macintosh (64-bit) Platforms
MATLAB Version 7.9 (R2009b) supports these new compilers for building
MEX-files:
• Apple Xcode 3.1 (gcc / g++ Version 4.0.1)
• GNU gfortran Version 4.3
Compiler Support to Be Phased Out
MATLAB Version 7.9 (R2009b) supports the following compilers but will
not support them in a future version.
Windows (32-bit) Platforms.
• Intel Visual Fortran Version 10.1
• Intel C/C++ Version 9.1
• Microsoft Visual Studio .NET Version 7.1
Windows (64-bit) Platforms.
• Intel Visual Fortran Version 10.1
• Intel C/C++ Version 9.1
105
Version 7.9 (R2009b) MATLAB® Software
Solaris SPARC (64-bit) Platforms.
• Sun Studio 11 cc / CC Version 5.8
• Sun Studio 11 f90 Version 8.2
Discontinued Support for Intel Visual Fortran Version 9.1
MATLAB no longer supports the Intel Visual Fortran Version 9.1 compiler
on the following platforms:
• Windows 32-bit
• Windows 64-bit
Compatibility Considerations. To ensure continued support for building
your Fortran programs, consider upgrading to another supported compiler.
For an up-to-date list of supported compilers, see the Supported and
Compatible Compilers Web page.
Run-Time Libraries Required for Applications Built
with Microsoft Visual Studio 2008 Compiler
You must provide the Visual C++® run-time libraries if you distribute any
of the following:
• MEX-file
• Engine application
• MAT-file application built with the Visual Studio® 2008 compiler
You need these files to run applications developed with Visual C++ on a
computer that does not have Visual C++ 2008 installed. For information on
locating the Microsoft® Visual C++® 2008 Redistributable Package (x86),
containing vcredist_x86.exe and vcredist_x64.exe, consult your Microsoft
documentation.
106
External Interfaces/API, MATLAB® Version 7.9 (R2009b)
Changes to Building MEX-Files
INLINE Option to MEX Function Deprecated
The use of the -inline switch has been deprecated and will not be available
in future versions of the mex function.
MEX Function No Longer Automatically Includes mexversion.c
When Building MEX-Files
The mex function no longer automatically compiles and links its own copy of
mexversion.c when generating MEX-files.
New Features for Interface to Microsoft .NET
Framework
This release includes several changes that affect your use of the Microsoft
.NET framework:
• The NET.addAssembly function returns information about the assembly in
the NET.Assembly class. You can also add an assembly using an instance
of the System.Reflection.AssemblyName class.
• You can access elements of a .NET array using MATLAB one-based
indexing, as described in “Accessing .NET Array Elements in MATLAB”.
• To call a generic method, use the NET.invokeGenericMethod function.
• You can change a static property or field name using the
NET.setStaticProperty function.
• You can use overloaded operators, such as + and *. For a complete list of
supported operators, see “Operator Overloading”.
107
Version 7.8 (R2009a)
MATLAB Software
This table summarizes what’s new in Version 7.8 (R2009a).
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized under
these topics:
• “Desktop Tools and Development Environment, MATLAB Version 7.8
(R2009a)” on page 111
• “Mathematics, MATLAB Version 7.8 (R2009a)” on page 123
• “Data Analysis, MATLAB Version 7.8 (R2009a)” on page 127
• “Programming Fundamentals, MATLAB Version 7.8 (R2009a)” on page 128
• “Graphics and 3-D Visualization, MATLAB Version 7.8 (R2009a)” on page
133
109
Version 7.8 (R2009a) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.8
(R2009a)” on page 134
• “External Interfaces/API, MATLAB Version 7.8 (R2009a)” on page 135
110
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
Desktop Tools and Development Environment, MATLAB
Version 7.8 (R2009a)
New features and changes introduced in this version are organized by these
topics:
• “Desktop New Features Video” on page 111
• “Startup and Shutdown” on page 111
• “Desktop” on page 111
• “Running Functions — Command Window and History” on page 113
• “Help and Related Resources” on page 113
• “Workspace, Search Path, and File Operations” on page 114
• “Editing and Debugging MATLAB Code” on page 115
• “Tuning and Managing MATLAB Code Files” on page 121
• “Publishing MATLAB Code Files” on page 121
Desktop New Features Video
For an overview of the major new features in the MATLAB Desktop Tools and
Development Environment area, watch this video demo. Another way to
access the demo is by selecting the Demos tab in the Help browser, and then
selecting MATLAB > New Features in Version 7.8.
Startup and Shutdown
The matlab command to start MATLAB now supports the -singleCompThread
option on all platforms. When you specify this option, you limit MATLAB to
a single computational thread. By default, if you do not specify this option,
MATLAB makes use of the multithreading capabilities of the computer on
which it is running.
Desktop
New features and changes introduced in Version 7.8 (R2009a) are:
111
Version 7.8 (R2009a) MATLAB® Software
• “New System Browser Preference Instead of docopt.m for MATLAB on
UNIX Platforms” on page 112
• “Test Proxy Settings for Accessing the Internet from MATLAB” on page 112
New System Browser Preference Instead of docopt.m for
MATLAB on UNIX Platforms
On UNIX platforms (except Apple Macintosh), MATLAB now uses the
Mozilla® Firefox® browser by default to display documents or Web sites in a
system browser. If you want MATLAB to use a different system browser,
use the new System Web browser setting in Web preferences to specify it.
In addition, the web function with the browser option now determines the
system browser to use from the preference. For more information, click the
Help button in the Web preference pane, or see “Web Preferences”.
Compatibility Considerations. In previous versions, the default system
browser on UNIX platforms was Netscape Navigator®; it is now Firefox. If
you do not have Firefox on your system, when MATLAB tries to use a system
browser, it produces a warning. To correct the problem, use Web preferences
to specify a system browser that is installed.
In previous versions, if you wanted to use a different browser, you specified
it in the docopt.m file. Starting in R2009a, MATLAB ignores the browser
specified in docopt.m. If you have code that relies on docopt.m, your code still
runs, but it produces a warning. Remove the calls from your code. In future
versions, the code will not run and will produce an error.
If you have your own docopt.m file, delete it and either use the new default,
Firefox, or specify a different system browser using Web preferences.
Test Proxy Settings for Accessing the Internet from MATLAB
If you want to access the Internet from MATLAB, and your network uses a
firewall or another means of protection that restricts Internet access, you
now can ensure your proxy server settings are working correctly. Click the
new Test Connection button in Web preferences, and MATLAB will use
the proxy settings you specified in Web preferences to attempt to access the
Internet. For more information about the proxy server features, click the
Help button in the Web preferences pane, or see “Web Preferences”.
112
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
Running Functions — Command Window and History
Tab Completion for Class Directories and File Names
The Command Window and Editor now support tab completion for class
directories. In addition, the Command Window supports tab completion for
class file names. For details, see “Tab Completion for Class Folders and File
Names”.
Help and Related Resources
New features and changes introduced in Version 7.8 (R2009a) are:
• “Help Browser No Longer Reopens at Startup” on page 113
• “docsearch Accepts Multiple Words Without Parentheses” on page 113
• “View Your Platform (32-bit or 64-bit) and Architecture in the About Dialog
Box” on page 114
Help Browser No Longer Reopens at Startup
When you start MATLAB, the Help browser no longer automatically opens
if you had it open when you last quit MATLAB.
Compatibility Considerations. In previous versions, the Help browser
opened at MATLAB startup if it had been open when you last quit MATLAB.
If you want the Help browser to automatically open at startup, use a startup
option. For example, you can include a helpbrowser statement in your
startup.m file. For more information, see “Startup Options”.
If you include a statement in a finish.m file that closes the Help browser
automatically whenever you quit MATLAB, you now can remove that
statement because MATLAB now performs the action by default.
docsearch Accepts Multiple Words Without Parentheses
The docsearch function, which you can use to search the documentation,
now accepts multiple words as input, without requiring the function form of
the syntax. For example, in previous versions, you used docsearch('word1
word2'), but now you can use docsearch word1 word2. With the new form
of the syntax, you can use all options for docsearch, such as wildcards (for
113
Version 7.8 (R2009a) MATLAB® Software
example, docsearch wor*) and exact phrases (for example, docsearch
"word1 word2").
View Your Platform (32-bit or 64-bit) and Architecture in the
About Dialog Box
To find out if you are currently running a 32-bit or 64-bit version of MATLAB,
select Help > About MATLAB, and view the value in the resulting About
MATLAB dialog box. You might need to know the version if you want to take
advantage of the benefits of 64-bit MATLAB, or if you want to use files that
depend on the version, such as MEX-files.
The About MATLAB dialog box also shows the architecture value, for
example, (win32) or (win64). You use this value for the arch option of the
mex function.
For more information, see “Obtaining Information About your Installation”.
Workspace, Search Path, and File Operations
Enhancements to Current Directory Browser
These are the enhancements to the Current Directory browser:
• You can use the new View menu to choose the columns to display, to
specify the sort order for a column, and to apply grouping for any attribute.
In the previous version, you performed these actions using the column
header and its context menus, which you can still do (but only on Microsoft
Windows platforms). For more information, see “Sorting and Grouping
Files and Folders”.
• A new Description column displays the brief description for files
and directories in the current directory. To show the column, use
View > Choose Columns. Descriptions include the first help line in a
MATLAB program file, and a model file’s description, which is useful
because you do not need to start the Simulink software to view it. The
description is the same one that appears with the details for a selected file.
For more information, see “Viewing Help for a MATLAB Program File”.
• If you try to rename a MATLAB program file in the Current Directory
browser to an invalid name, such as *myfile.m, a warning appears,
114
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
notifying you about the name problem. If you want to run the ile, change
the file name to a valid one. For more information about what a MATLAB
file name requires to be valid so you can run it, see “Naming Functions”.
• When you right-click a FIG-file in the Current Directory browser, there is a
new option to open the figure in GUIDE.
Editing and Debugging MATLAB Code
New features and changes introduced in Version 7.8 (R2009a) are:
• “Many M-Lint Messages Now Extend to Provide an Explanation and
Suggested Action” on page 115
• “M-Lint Messages Now Searchable in Preferences” on page 117
• “Block Indenting Option No Longer Provided” on page 120
• “Integrated Text Editor Option Removed from Editor/Debugger Preferences
Panel” on page 120
• “New Navigation Aids in File and Directory Comparisons Tool” on page 120
• “Wrap Around Option for Find and Replace Now On By Default” on page
120
Many M-Lint Messages Now Extend to Provide an Explanation
and Suggested Action
When you create a file with integrated M-Lint warning and error messages
enabled, you can get additional information about many of the messages.
When you hover the pointer over an M-Lint indicator that has an extended
message, the message appears as a link:
115
Version 7.8 (R2009a) MATLAB® Software
When you click the link, the message window expands to display an
explanation and suggested action.
116
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
When you click a link within the extended message, the Help browser opens
to provide more information. For details, see “Automatically Analyzing Code
in the Editor”.
M-Lint Messages Now Searchable in Preferences
You can now filter the list of M-Lint messages in the preferences panel
(File > Preferences > M-Lint), to find a message of interest.
117
Version 7.8 (R2009a) MATLAB® Software
For example, you can search for a message:
• Containing a string
• Corresponding to a particular message ID
• Within a given category
• With a setting different from the default
Filtering the list of messages can help you see, for example, why certain
messages are suppressed, and which messages are disabled. It can be helpful
when you want to see the explanation and suggested action for a message, as
described in “Many M-Lint Messages Now Extend to Provide an Explanation
and Suggested Action” on page 115.
118
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
For details about filtering M-Lint messages, see “Setting Code Analyzer
Preferences”.
119
Version 7.8 (R2009a) MATLAB® Software
Block Indenting Option No Longer Provided
The Block Indent option is no longer available. Previously, this option was
available for MATLAB, Java, and C/C++ programming languages, when you
selected File > Preferences > Editor/Debugger > Language.
Note Do not confuse the Block Indent option with the Smart indenting
option, which is still provided.
Compatibility Considerations. To attain the effect of block indenting,
you can use the No indent option and indent lines manually using the Tab
and space keys.
Integrated Text Editor Option Removed from Editor/Debugger
Preferences Panel
The MATLAB Editor no longer supports EmacsLink. In previous releases,
you could choose File > Preferences > Editor/Debugger, and then (if you
correctly registered EmacsLink with MATLAB) you could select Integrated
text editor. This option is no longer available.
New Navigation Aids in File and Directory Comparisons Tool
The File and Directory Comparisons Tool now provides links to help you
quickly navigate to the areas of differences. This is useful for large files that
have too many lines to fit on the screen. At the top of the page is a link to the
first difference. In addition, each set of differences has an up arrow that you
click to go to the previous set of differences, and a down arrow you click to go
to the next set of differences. For details, see “Stepping Through Differences”.
Wrap Around Option for Find and Replace Now On By Default
When the Find Next operation for searching files in the Editor reaches the
end of a file, it automatically wraps around to search from the beginning of
the file for the text you specified. In previous releases, the Wrap around
option was off by default. This meant that if you were in the middle of a file
and the text you were searching for appeared before your current position,
Find Next would not find that text.
120
Desktop Tools and Development Environment, MATLAB® Version 7.8 (R2009a)
Because it is more convenient to have this option on, it is now selected by
default. To access this option, select Edit > Find and Replace.
For more information, see “Finding Text in Files”.
Tuning and Managing MATLAB Code Files
Profile Summary Report Includes Information on Excluded
Profiling Overhead
The bottom of the Profile Summary Report now indicates the amount of time
spent in profiling overhead, when possible. For details, see “Profile Summary
Report”.
Publishing MATLAB Code Files
New features and changes introduced in Version 7.8 (R2009a) are:
• “New Options for Capturing Figures in Published Documents” on page 121
• “Dynamic Links in Published Documents” on page 122
New Options for Capturing Figures in Published Documents
Two new options are available to specify how you want figures captured for
published documents: entireGUIWindow and entireFigureWindow. The
entireGUIWindow option is appropriate for most publishing purposes and
is now the default. The entireFigureWindow option is appropriate when
you want to capture all the details, including the title bar and other window
decorations in your published document. Use this option, for example, if you
are creating a tutorial on using MATLAB software. In the GUI, you can select
these options from the Figure capture method setting in the Edit M-file
Configuration dialog box. In the publish function, you can specify these
options with figureSnapMethod.
For more information, see “Figure capture method” and the publish reference
page.
121
Version 7.8 (R2009a) MATLAB® Software
Dynamic Links in Published Documents
When you publish a document to HTML, you can include dynamic links.
Dynamic links are links to files on the MATLAB path. They are called
dynamic links because MATLAB evaluates them when the reader of your
document clicks on one. To use a dynamic link, the reader must open the
HTML file in the MATLAB Web browser.
For more information, see “Inserting Dynamic Hyperlinks”.
122
Mathematics, MATLAB® Version 7.8 (R2009a)
Mathematics, MATLAB Version 7.8 (R2009a)
New features and changes introduced in this version are:
• “Upgrade to Computational Geometry” on page 123
• “Incomplete Inverse Gamma Function gammaincinv and Incomplete
Inverse Beta Function betaincinv” on page 124
• “Krylov Subspace Methods bicgstabl and tfqmr” on page 124
• “New Function quad2d” on page 124
• “Changes To conv” on page 124
• “Changes To conv2 and convn” on page 124
• “nextpow2 Changing to Element-By-Element Calculation in a Future
Release” on page 125
• “Function finite Being Removed” on page 125
• “New Multithreading Capability in MATLAB Functions” on page 125
• “64-bit Support in LAPACK and BLAS” on page 125
• “Upgrade to ACML 4.1.0” on page 126
Upgrade to Computational Geometry
MATLAB includes a new object-oriented suite of computational geometry
tools, together with a new underlying library called CGAL. The new library
provides improved robustness, performance, and memory efficiency. The new
tools are presented in three classes:
• New class TriRep provides topological and geometric queries for
triangulations in 2-D and 3-D space.
• New class DelaunayTri provides increased functionality for Delaunay
triangulation including topological and geometric queries, incremental
modification, and edge constraints.
• New class TriScatteredInterp provides fast robust scattered data
interpolation and a new natural-neighbor interpolation technique.
123
Version 7.8 (R2009a) MATLAB® Software
Incomplete Inverse Gamma Function gammaincinv
and Incomplete Inverse Beta Function betaincinv
MATLAB has new functions for incomplete inverse gamma and incomplete
inverse beta functions. These functions, gammaincinv and betaincinv,
provide the Statistics Toolbox functionality of the inverse incomplete gamma
and beta functions to MATLAB.
Krylov Subspace Methods bicgstabl and tfqmr
MATLAB has new iterative methods for solving systems of linear equations.
bicgstabl provides the stabilized biconjugate gradients method. tfqmr
provides a transpose-free implementation of the quasi-minimal residual
method.
New Function quad2d
The quad2d function provides additional quadrature functionality for
nonrectangular areas of integration.
Changes To conv
The conv function now accepts the shape parameter as input.
Changes To conv2 and convn
Use of the conv2 and convn functions with one empty input now returns the
matrix of the correct size as described by the shape input.
Compatibility Considerations
Use of the conv2 and convn functions with one empty input no longer returns
an empty matrix. Instead, it returns the matrix of size specified by the shape
input. For information on how to use the shape input, see the reference pages
for the conv and conv2 functions.
124
Mathematics, MATLAB® Version 7.8 (R2009a)
nextpow2 Changing to Element-By-Element
Calculation in a Future Release
Compatibility Considerations
nextpow2 with a nonscalar produces a warning:
Warning: NEXTPOW2(X) where X is non-scalar will change
behavior in future versions: it will operate on each element
of X. To retain current behavior, use NEXTPOW2(LENGTH(X)) instead.
This behavior will change in a future release. Replace instances of nextpow2
with nonscalar input X to nextpow2(length(X)) to maintain the current
behavior.
Function finite Being Removed
The finite function is obsolete. Use of the finite function now causes an
error in MATLAB.
Compatibility Considerations
Replace all instances of finite with isfinite.
New Multithreading Capability in MATLAB Functions
The MATLAB functions for Fourier transforms fft, fft2, and fftn, and their
inverses ifft, ifft2, and ifftn are now multithreaded. In addition, the
MATLAB functions prod, sum, max, and min are multithreaded.
64-bit Support in LAPACK and BLAS
MATLAB supports 64-bit integers for matrix dimensions in LAPACK, and
BLAS. Linear algebra operations can now handle matrices of dimensions
greater than 231 − 1 .
Compatibility Considerations
MEX files that call BLAS or LAPACK need to be updated. All integer variables
passed into BLAS or LAPACK need to be of type mwSignedIndex. MEX files
125
Version 7.8 (R2009a) MATLAB® Software
compiled in previous versions of MATLAB that call BLAS or LAPACK could
lead to undefined behaviors. If you have existing code that generates MEX files
that pass variables to BLAS or LAPACK you need to update the code to use
the proper data types and recompile.
Upgrade to ACML 4.1.0
AMD Core Math Library (ACML) is upgraded to version 4.1.0.
126
Data Analysis, MATLAB® Version 7.8 (R2009a)
Data Analysis, MATLAB Version 7.8 (R2009a)
There were no new features or changes in this version. However, see
the “Compatibility Considerations” on page 227 section of Version 7.6
(R2008a) Data Analysis release note “Data Brushing for Graphs and Linked
Variables” on page 223. The data brushing and linked plot message bar
affects the appearance of images of figure windows captured as images. This
incompatibility was not recognized at the time R2008a shipped.
127
Version 7.8 (R2009a) MATLAB® Software
Programming Fundamentals, MATLAB Version 7.8
(R2009a)
New features and changes introduced in this version are
• “Setting the Number of Threads Removed from Preferences Panel” on page
128
• “Timer Objects Saved in New Format” on page 129
• “mmreader Supports Linux Platforms” on page 129
• “Support of Microsoft® Excel 2007 File Formats” on page 129
• “Anonymous Functions Support str2func” on page 130
• “size and range Implemented for validateattributes” on page 130
• “isempty Supported for Map Objects” on page 130
• “Bug Fix for Misinterpreted Variables” on page 131
• “MATLAB Upgrades Support for HDF5 to Version 1.8.1” on page 132
• “Indirect Calls to Superclass Constructors Now Errors” on page 132
Setting the Number of Threads Removed from
Preferences Panel
The capability to adjust the number of computational threads in a single
MATLAB session is no longer available as of this release. This change removes
from the MATLAB preferences panel the ability to set the maximum number
of computational threads. The primary reason for this change is that products
that MATLAB is dependent upon have the ability to spawn threads from the
currently-executing thread. This makes it infeasible to monitor and/or limit
the number of computational threads at any given time in a MATLAB process.
MATLAB versions 7.8 and later require that you decide between
threading and no threading at the time you launch your MATLAB session.
Multithreading is enabled by default. To disable this feature, start MATLAB
using the new singleCompThread option.
128
Programming Fundamentals, MATLAB® Version 7.8 (R2009a)
Compatibility Considerations
If you currently use the preferences panel to enable or disable multithreading
or to adjust the number of computational threads, you need to be aware that
this capability is no longer available. See the “Startup Options”section in the
Desktop Tools and Development Environment documentation to find out how
to enable or disable multithreading when launching a new MATLAB session.
Timer Objects Saved in New Format
The format in which MATLAB saves Timer objects has changed in MATLAB
version 7.8. Any Timer objects that you create and save while running
MATLAB 7.8 cannot be loaded into an earlier version of MATLAB.
Compatibility Considerations
If you need to use a Timer object that you have constructed using MATLAB
7.8, you will have to reconstruct and save the object in an earlier version
of MATLAB.
mmreader Supports Linux Platforms
The mmreader object now supports Linux platforms. For more information
about using mmreader, see the mmreader reference page.
Support of Microsoft Excel 2007 File Formats
If you have installed Excel 2007 (or Excel 2003 with the Compatibility Pack)
on your Windows system, the xlswrite function exports data to XLSX, XLSB,
and XLSM formats.
To write data to an Excel file, specify the name and extension of the output
file in the call to xlswrite. If the file already exists, xlswrite writes data
in the existent file format. If the file does not exist, xlswrite creates a new
file, using the format that corresponds to the file extension you specify. If
you do not specify a file extension, xlswrite applies the XLS extension, and
writes a new file in the XLS format.
The xlsread function imports any file format recognized by your version of
Excel, including XLS, XLSX, XLSB, XLSM, and HTML-based formats. The
129
Version 7.8 (R2009a) MATLAB® Software
importdata function imports XLS, XLSX, XLSB, and XLSM formats. The
Import Wizard imports XLS and XLSX formats.
Note Large files in XLSX format might load very slowly. For better import
and export performance, Microsoft recommends that you use the XLSB format.
Anonymous Functions Support str2func
The str2func which, prior to this release, converted a function name to
a function handle, now also converts an anonymous function definition to
a function handle. See the function reference page for str2func for more
information.
N = 5;
NthPower = str2func(['@(x)x.^', num2str(N)]);
NthPower(8)
ans =
32768
size and range Implemented for validateattributes
The validateattributes function now enables you to check the size and
range of the input value. The following commands validate the size and range
of the values of x and y respectively:
x = rand(4,2,6);
y = uint8(50:10:200);
validateattributes(x, {'numeric'}, {'size', [4,2,6]});
validateattributes(y, {'uint8'}, {'>=', 50, '<=', 200})
isempty Supported for Map Objects
MATLAB now supports the isempty function for containers.Map objects.
This example creates a 0-by-1 Map object and runs isempty on it:
mapObj = containers.Map;
size(mapObj)
ans =
0
1
130
Programming Fundamentals, MATLAB® Version 7.8 (R2009a)
isempty(mapObj)
ans =
1
Bug Fix for Misinterpreted Variables
The example below describes a bug in the MATLAB software that has
been fixed in version 7.8. The bug was caused by misinterpretation of an
unassigned variable. For certain names, MATLAB mistakenly interpreted
the variable as a stem in dot indexing.
The following example illustrates the problem. The example is a bit artificial
(which is why the bug went undiscovered for so long).
Suppose you have a function that is intended to perform two levels of
dot-indexing:
function y = dotindextwice_A(j)
y = j.lang.String;
Calling this function with no arguments results in an error in all versions of
MATLAB, as it should.
Now modify the function slightly so that the input variable is named java and
run it on a version of MATLAB prior to Version 7.8:
function y = dotindextwice_B(java)
y = java.lang.String;
Now when you run the function without arguments, MATLAB misinterprets
the word java, treating it as if it were the stem of a Java class name:
x = dotindextwice_B;
% Deliberately called with no arguments
Prior to Version 7.8, this function did not throw an error. In fact, it returned
an instance of the java.lang.String class:
class(x)
ans =
java.lang.String
131
Version 7.8 (R2009a) MATLAB® Software
This violates the rule that variables in functions are supposed to hide all other
uses of the name. Beginning in Version 7.8, calling function dotindextwice_B
without arguments results in an error, just as calling dotindextwice_A does.
MATLAB Upgrades Support for HDF5 to Version 1.8.1
The R2009a release of MATLAB uses version 1.8.1 of the HDF5 library. The
HDF Group has deprecated two of the HDF5 library functions, H5Pget_cache
and H5Pset_cache. Their M-file counterparts, H5P.get_config and
H5P.set_config, may not work as they did in prior releases of MATLAB.
To replace these deprecated functions in your code, consider these four
new HDF5 functions: H5P.get_mdc_config, H5P.set_mdc_config,
H5F.get_mdc_config, and H5F.set_mdc_config.
Compatibility Considerations
If your code uses H5P.get_cache or H5P.get_cache, your program will
produce a warning message.
Indirect Calls to Superclass Constructors Now Errors
You can no longer call an indirect superclass constructor from a subclass
constructor. For example, suppose class B is derived from class A, and class
C is derived from class B. The constructor for class C should not call the
constructor for class A to initialize properties. The call to initialize class A
properties should be made from class B.
Compatibility Considerations
If you define classes in which subclass constructors call indirect superclass
constructors, MATLAB now issues an error when you attempt to create an
instance of the subclass. “Call Only Direct Superclass from Constructor” for
information on how to correctly code subsclass constructors.
132
Graphics and 3-D Visualization, MATLAB® Version 7.8 (R2009a)
Graphics and 3-D Visualization, MATLAB Version 7.8
(R2009a)
New features and changes introduced in this version are:
Functions Previously Only Available in the Image
Processing Toolbox Now Available in MATLAB
The following functions have been added to MATLAB from the Image
Processing Toolbox:
• rgb2ind: Convert RGB image to indexed image.
• dither: Convert image using dithering.
• cmunique: Eliminate unneeded colors in colormap of indexed image.
• cmpermute: Rearrange colors in colormap.
• imapprox: Approximate indexed image by one with fewer colors.
Compatibility Considerations
• The dither and imapprox functions no longer display their output as an
image via a call to imshow when called with no output arguments. Instead,
the first output argument appears in the Command Window if no semicolon
ends the line.
• Function rgb2ind errors when called with syntax rgb2ind(rgb).
• Function imapprox errors when called with syntax imapprox(x,map).
133
Version 7.8 (R2009a) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.8 (R2009a)
New features and changes introduced in this version are:
• “New Programmatic GUI Doc Example” on page 134
• “GUIDE Help Menu Enhanced” on page 134
New Programmatic GUI Doc Example
A new example in the documentation teaches you how to code a GUI that
manages multiple lists, such as to-do and shopping lists, contact information,
music or video catalogs, or any set of itemizations. Among other things, it
illustrates how to write MATLAB code to:
• Share callbacks among uicontrols.
• Obtain component handles from their tags.
• Create a new version of an existing GUI.
• Import and export list data.
• Edit, add, delete, and reorder list items.
• Save a list in the GUI itself.
• Concurrently run multiple GUIs containing different data that call back
to the same function.
This example does not use GUIDE. To read about and run it, see “A GUI
That Manages List Data” in the documentation for Creating Graphical User
Interfaces.
GUIDE Help Menu Enhanced
The Help menu in GUIDE now links to more topics in the documentation than
previously. It also links to a set of video tutorials on the MATLAB Central
Web site. For details, see “Getting Help in GUIDE” in the Opening GUIDE
section of the Creating Graphical User Interfaces documentation.
134
External Interfaces/API, MATLAB® Version 7.8 (R2009a)
External Interfaces/API, MATLAB Version 7.8 (R2009a)
New features and changes introduced in this version are:
• “New Interface to Microsoft .NET Framework” on page 135
• “Expanded Platform Support Added for MATLAB Serial Port” on page 135
• “Changes To Compiler Support” on page 136
• “Do Not Use mxFree to Destroy mxArrays” on page 137
• “Cannot Build MEX-Files Using MATLAB Version 5 API” on page 138
• “MEX-Files Calling BLAS or LAPACK Functions Must Be Updated On
64-Bit Platforms” on page 138
• “Object .o Files Saved on Macintosh Systems for Debugging” on page 139
• “Run-Time Libraries Required for Applications Built with Microsoft® Visual
Studio 2008 Compiler” on page 139
• “New Features for Shared Library Interface” on page 139
• “New Java Thread Safety Functions” on page 139
• “Improved Robustness of Web Services Functions” on page 140
New Interface to Microsoft .NET Framework
The interface to .NET allows you to bring .NET assemblies into the MATLAB
environment, to construct objects from classes contained in the assemblies,
and to call methods on these objects. For complete documentation of this
feature, see “MATLAB Interface to .NET Framework”. For an overview of the
.NET interface, watch this video demo.
Expanded Platform Support Added for MATLAB
Serial Port
MATLAB Serial Port is now supported on the following platforms:
• Microsoft Windows 64-bit
• Apple Macintosh OS X
• Macintosh OS X 64-bit
135
Version 7.8 (R2009a) MATLAB® Software
• Linux
• Linux 64-bit
• Sun Solaris 64-bit
Changes To Compiler Support
New Compiler Support
MATLAB Version 7.8 (R2009a) supports these new compilers for building
MEX-files:
Microsoft Windows (64- and 32-bit) Platforms.
• Microsoft Visual Studio 2008 SP1
Linux (64- and 32-bit) Platforms.
• gcc Version 4.2.3
Apple Macintosh (32-bit) Platforms.
• GNU gfortran Version 4.2.2
Compiler Support To Be Phased Out
The following compilers are supported in Version 7.8 (R2009a), but will not be
supported in a future version of MATLAB:
Windows (32-bit) Platforms.
• Intel Visual Fortran Version 9.1
• Intel Visual Fortran Version 10.1
• Intel C/C++ Version 9.1
• Microsoft Visual Studio .NET Version 7.1
136
External Interfaces/API, MATLAB® Version 7.8 (R2009a)
Windows (64-bit) Platforms.
• Intel Visual Fortran Version 9.1
• Intel Visual Fortran Version 10.1
• Intel C/C++ Version 9.1
Solaris SPARC (64-bit) Platforms.
• Sun Studio 11 cc / CC Version 5.8
• Sun Studio 11 f90 Version 8.2
Discontinued Compiler Support
MATLAB no longer supports the following compilers:
Windows (32-bit) Platforms.
• Open Watcom Version 1.3
• Microsoft Visual Studio 2005 Express Edition
Windows (64-bit) Platforms.
• Microsoft Platform SDK
Apple Macintosh (32-bit) Platforms.
• g95 Version 0.90
Compatibility Considerations. To ensure continued support for building
your C/C++ programs, consider upgrading to another supported compiler. For
an up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
Do Not Use mxFree to Destroy mxArrays
It is improper to call mxFree on an mxArray. Previously, to remedy misleading
statements in older documentation, under limited circumstances, MATLAB
137
Version 7.8 (R2009a) MATLAB® Software
issued a warning in code that made this error. MATLAB no longer issues
the warning.
Compatibility Considerations
The correct function to use to release memory for an mxArray is
mxDestroyArray. Calling mxFree on an mxArray could cause memory
corruption, which might result in a segmentation violation.
Cannot Build MEX-Files Using MATLAB Version 5 API
MATLAB does not support the -V5 option to the mex function.
Compatibility Considerations
You are no longer able to build a MEX-file using the MATLAB Version 5
API. If you use any of the functions shown in the “Obsolete Functions: MX
Array Manipulation” on page 428 table, you must replace them with functions
from the Replacement column, if available. These obsolete functions were
deprecated when MATLAB Version 6 was released over 5 years ago.
MEX-Files Calling BLAS or LAPACK Functions Must Be
Updated On 64-Bit Platforms
You must update any MEX-file that calls functions in the BLAS or LAPACK
math packages on 64-bit platforms. The change occurs as a result of updated
support, described in “64-bit Support in LAPACK and BLAS” on page 125.
Existing MEX-files generated in previous versions of MATLAB will result in
undefined behavior (likely crashes), if run in R2009a. The previous versions
pass 32-bit integer arguments, but the math routines now read and write
to 64 bits of memory. The results you see depend on what is stored in the
subsequent 32 bits of memory.
Compatibility Considerations
On 64-bit platforms, you must use 64-bit integers for all input and output
variables when calling LAPACK and BLAS routines in C and Fortran source
MEX-files. Use the mwSignedIndex type for platform-independent code.
138
External Interfaces/API, MATLAB® Version 7.8 (R2009a)
Object .o Files Saved on Macintosh Systems for
Debugging
MATLAB saves object .o files when compiling MEX-files on Apple Mac OS®
Version 10.5 systems so that you can use source-level debugging.
Run-Time Libraries Required for Applications Built
with Microsoft Visual Studio 2008 Compiler
If you distribute a MEX-file, an engine application, or a MAT-file application
built with the Visual Studio 2008 compiler, you must provide the Visual C++
run-time libraries. These files are required to run applications developed with
Visual C++ on a computer that does not have Visual C++ 2008 installed.
For information on locating the Microsoft Visual C++ 2008 Redistributable
Package (x86), containing vcredist_x86.exe and vcredist_x64.exe, consult
your Microsoft documentation.
New Features for Shared Library Interface
• It is now possible to use the char** return value and to increment the
resulting pointer to retrieve all values. See “Passing an Array of Strings”.
• Added support for accessing values exported by a library.
• All fully and partly sized arrays should now work.
New Java Thread Safety Functions
Use the following new functions to work with Sun Java objects on the Event
Dispatch Thread (EDT).
Function
Description
javaObjectEDT
Construct Java object on EDT
javaMethodEDT
Call Java method from EDT
139
Version 7.8 (R2009a) MATLAB® Software
Improved Robustness of Web Services Functions
The underlying technology used in the createClassFromWsdl and
parseSoapResponse functions was modified to better ensure support for
WSDL and SOAP standards.
Compatibility Considerations
There was no intended change to functionality or results of the
createClassFromWsdl and parseSoapResponse functions, which MathWorks
verified through testing. There are many variations among WSDL files and
Web services and they cannot all be tested. Therefore, it is possible that your
results using the createClassFromWsdl and parseSoapResponse functions in
this version could differ from a previous version.
Ensure that your results using createClassFromWsdl and
parseSoapResponse functions are as expected.
140
Version 7.7 (R2008b)
MATLAB Software
This table summarizes what’s new in Version 7.7 (R2008b):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.7
(R2008b)” on page 143
• “Mathematics, MATLAB Version 7.7 (R2008b)” on page 166
• “Data Analysis, MATLAB Version 7.7 (R2008b)” on page 168
• “Programming Fundamentals, MATLAB Version 7.7 (R2008b)” on page 169
• “Graphics and 3-D Visualization, MATLAB Version 7.7 (R2008b)” on page
179
141
Version 7.7 (R2008b) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.7
(R2008b)” on page 182
• “External Interfaces/API, MATLAB Version 7.7 (R2008b)” on page 185
142
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
Desktop Tools and Development Environment, MATLAB
Version 7.7 (R2008b)
New features and changes introduced in this version are organized by these
topics:
• “Desktop New Features Video” on page 143
• “Startup and Shutdown” on page 143
• “Desktop” on page 147
• “Running Functions — Command Window and History” on page 148
• “Help and Related Resources” on page 151
• “Workspace, Search Path, and File Operations” on page 153
• “Editing and Debugging MATLAB Code” on page 160
• “Tuning and Managing MATLAB Code Files” on page 164
• “Publishing MATLAB Code Files” on page 164
Desktop New Features Video
For an overview of the major new features in the MATLAB Desktop Tools
and Development Environment area, watch this video demo. Another way
to access this and other video demos is to select the Demos tab in the Help
browser, and then select MATLAB > New Features in Version 7.7.
Startup and Shutdown
New features and changes introduced in Version 7.7 (R2008b) are:
• “Macintosh Startup and Root Directory Enhancements and Changes” on
page 144
• “Updated Version of JVM Software” on page 145
• “Specifying Address Space Protection During Startup on Windows
Platforms” on page 145
• “Changes to -nojvm Startup Option” on page 145
• “Changes to matlab Memory Manager Startup Options” on page 146
143
Version 7.7 (R2008b) MATLAB® Software
Macintosh Startup and Root Directory Enhancements and
Changes
MATLAB for Apple Macintosh platforms is now installed like many other
applications for Macintosh platforms, as a Macintosh .app bundle. This has
resulted in some enhancements and changes to starting and using MATLAB
on Macintosh platforms.
Startup Location. To start MATLAB on the Macintosh platform, double-click
the MATLAB_R2008b icon in the Applications folder. This differs from R2008a
(V7.6), where you started MATLAB by double-clicking the MATLAB 7.6 icon
in the Applications/MATLAB_R2008a folder; there was an additional folder
level in R2008a.
Starting MATLAB from a File. You can now start MATLAB by
double-clicking a file with a file extension that has been associated with
MATLAB, such as a file with a .m extension. Similarly, you can drag a file
onto the MATLAB_R2008b icon in the Applications folder or in the dock. These
actions start MATLAB and open the file.
Contents of MATLAB Root Directory. When you use file browser GUIs to
navigate in the MATLAB root directory, /Applications/MATLAB_R2008b,
(known as the matlabroot directory), you cannot directly view or access
its contents. For example, when you select File > Open and navigate
to Applications/MATLAB_R2008b, no contents display. To access the
contents, press Command+Shift+G, and enter the path to the MATLAB
root directory in the resulting Go To Folder dialog box, for example,
/Applications/MATLAB_R2008b.app.
Similarly, when you select MATLAB_R2008b in the Applications folder using
the Finder, you do not see the contents. To access the contents, right-click
(or Ctrl+click) MATLAB_R2008b, and from the context menu, select Show
Package Contents. For more information, see “Using File Browser GUIs on
Macintosh Platforms to Navigate Within the MATLAB Root Folder”.
Startup Options and the Start MATLAB Settings Dialog Box. You can
no longer set startup options using the Start MATLAB Settings dialog box
and you can no longer start MATLAB from any .smat files you saved using
Start MATLAB Settings. The dialog box is now used only for diagnostics and
only appears if MATLAB experiences a problem during startup.
144
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
To set the startup directory in MATLAB, use the userpath function. To
instruct MATLAB to run a specified statement upon startup, start MATLAB
using the matlab command from a shell, as you would to start MATLAB on
any UNIX platform. For more information, see .
Starting MATLAB in a Shell. In R2008b (V7.7), to start
MATLAB from a shell, enter the path to the executable,
/Applications/MATLAB_R2008b.app/bin/matlab. This differs from R2008a
(V7.6), in which the path was /Applications/MATLAB_R2008a/bin/matlab.
Compatibility Considerations. The compatibility considerations are
described along with the above changes.
Updated Version of JVM Software
MATLAB is now using Sun Microsystems™ JVM™ Version 6 Update 4
software on all platforms, except the Apple Macintosh platform. If you specify
a version of Java software to use with MATLAB, this change might impact
your work.
Specifying Address Space Protection During Startup on
Windows Platforms
When you start MATLAB on Microsoft Windows 32-bit platforms, you can
set a startup option to help ensure the largest available contiguous block of
memory after startup, which is useful if you run memory-intensive operations,
such as processing large data sets. You can use the new -shield startup
option to specify different levels of protection of the address space during the
MATLAB startup process. This can also help resolve problems if MATLAB
fails to start. For more information, see the matlab (Windows) reference
page.
Changes to -nojvm Startup Option
When you start MATLAB with the -nojvm startup option, Handle Graphics®
functionality will no longer be supported. (The -nojvm option is available for
UNIX platforms; see background information at the matlab (UNIX) reference
page.)
145
Version 7.7 (R2008b) MATLAB® Software
Some aspects of MATLAB and related products use Handle Graphics in a way
that might not be obvious. This includes anything that is based on or works
using figures in MATLAB. Here is a summary of the affected features:
• Creating figures and performing plotting tasks, such as using the plot,
axes, getframe, and gcf functions.
• Printing figures and using related functions such as print, hgexport,
and saveas.
• Creating GUIs in MATLAB using GUI-building functions such as warndlg.
• Using Simulink scopes and printing Simulink models.
In MATLAB Version 7.7 (R2008b), if you use the -nojvm startup option and
use Handle Graphics functionality, MATLAB produces this warning:
This functionality is no longer supported under the -nojvm startup option
In a future release, instead of a warning, MATLAB will produce an error when
you start with the -nojvm option and use Handle Graphics functionality.
Compatibility Considerations. To avoid the warning, start MATLAB
without the -nojvm startup option:
• If you have been using the -nojvm startup option to work in a command
line environment or because you do not use the MATLAB desktop, use the
-nodesktop startup option instead.
• If you have been using the -nojvm startup option because of memory or
performance benefits, look for other ways to gain those improvements when
you start MATLAB without the -nojvm option. See the “Performance”
and “Memory Usage” topics in the MATLAB Programming Fundamentals
documentation.
• If you want to continue to use the -nojvm startup option, remove the code
that is now producing the warnings.
Changes to matlab Memory Manager Startup Options
The matlab command line arguments -memmgr and -check_malloc are
deprecated and will be removed in a future release. The environment variable
146
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
MATLAB_MEM_MGR is also deprecated and will be removed. For information
about these options, see matlab (Windows) or matlab (UNIX).
Compatibility Considerations. If you use these options, MATLAB
generates a warning message.
Desktop
New features and changes introduced in Version 7.7 (R2008b) are:
• “New Default Layout for Desktop” on page 147
• “Closing Document Windows Using Middle Mouse Button” on page 147
• “Preferences Opens to Last Pane Used” on page 147
• “Changes to Desktop Text Font” on page 148
• “Provide Authentication Settings for Proxy Server when Accessing the
Internet from MATLAB” on page 148
New Default Layout for Desktop
There is a new desktop layout when you select Desktop > Desktop
Layout > Default. It includes the same components as the previous default
desktop layout, however, they are arranged differently. If you prefer the
previous default layout, arrange your desktop in that way and save the layout.
You then can reuse the saved layout at any time.
Closing Document Windows Using Middle Mouse Button
If you have multiple documents open, you can now close a document by
clicking the middle mouse button when the pointer is in the document’s
button on the document bar.
Preferences Opens to Last Pane Used
When you open the Preferences dialog box, it displays the last preference pane
you viewed in the current session. In prior versions, the Preferences dialog
box displayed the pane associated with the tool from which you accessed it.
147
Version 7.7 (R2008b) MATLAB® Software
Changes to Desktop Text Font
You now can specify that the desktop text font use the system default font.
To do this, select File > Preferences > Fonts. Then, for Desktop text
font, select Use system font. For more information, click the Help button
in the Fonts Preferences dialog box.
The default settings for the desktop text font and the HTML Proportional
Text font have changed. This only affects existing users who choose to use a
new preferences file (matlab.prf) in R2008b.
Provide Authentication Settings for Proxy Server when
Accessing the Internet from MATLAB
If you want to access the Internet from MATLAB and your network uses a
firewall or another means of protection that restricts Internet access and
requires you to provide a username and password, use the new proxy server
authentication settings in Web preferences to specify the values. For more
information, click the Help button in the Web preferences pane, or see “Web
Preferences”.
Running Functions — Command Window and History
• “Find Function Names and Get Help Using the New Function Browser”
on page 148
• “View Syntax Hints While Entering Statements” on page 149
Find Function Names and Get Help Using the New Function
Browser
While you work, you can find the names of functions and get help for them
using the new Function Browser. The Function Browser is useful if you want
to find a function whose name you cannot remember, determine if there are
functions that do what you want, or view the reference page for a function.
The Function Browser uses a subset of the information found in the function
reference pages in the Help browser for quick access while you work.
To access the Function Browser, press Shift+F1, or if you are in the Command
Window or Editor, click the Function Browser button
. The Function
Browser opens. You can specify the products to look in, browse categories of
148
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
functions, and search for words that appear in function reference pages. For
more information, see “Finding Functions Using the Function Browser”.
1. To open the Function Browser,
click its button or press Shift+F1.
4. Select a function to view
quick help for it in a pop-up window.
2. Find
categories
and functions
whose
help contains
words you
specify.
3. Click to
change
the scope
of product
documentation
to look in.
5. To use a function, drag it from the
Function Browser to a tool, such as the
Command Window.
View Syntax Hints While Entering Statements
While you enter statements in the Command Window and Editor, you can
view the allowable input argument syntax for a function in a pop-up window.
This feature is called function hints. To use function hints:
1 Type the function name, followed by the left parenthesis, (, and pause. The
syntax for input arguments automatically displays in a pop-up window
near the statement you are entering.
149
Version 7.7 (R2008b) MATLAB® Software
2 The arguments you can enter appear in bold. Enter your first argument
and type a comma ( , ) after it. The syntax options in the pop-up window
then change, based on the argument you just entered.
3 Continue entering arguments, using the hints as needed. You can dismiss
the function hints pop-up window at any time by pressing Esc. When you
type the closing parenthesis, ), or when there are no more arguments to
enter, the pop-up window automatically closes.
The following illustration shows function hints for the plot function.
To turn off the function hints feature so the pop-up menu does not
automatically display the syntax reminders when you type an opening
parenthesis, use Keyboard preferences; for Function Hints, clear the check
box that enables them.
For more information, see “Viewing Function Syntax Hints While Entering a
Statement”.
150
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
Help and Related Resources
• “New Help Features — Function Browser and Function Hints” on page 151
• “Viewing an HTML Version of Help for Classes You Create” on page 151
• “Finding Text In Small Help Windows” on page 153
• “Changes to Search Field in Help Browser” on page 153
New Help Features — Function Browser and Function Hints
There are two new features that provide help while you work:
• Use the new Function Browser to find function names while you work. It
is most useful in the Command Window and Editor, but you can access it
from any tool. For more information, see “Find Function Names and Get
Help Using the New Function Browser” on page 148.
• Use function hints to help you complete syntax for statements in the
Command Window or Editor. For more information, see “View Syntax
Hints While Entering Statements” on page 149.
Viewing an HTML Version of Help for Classes You Create
If you create your own class definition files in MATLAB and you provide
help in the classdef file for the class, properties, and methods, you can
conveniently view the help in the Help browser by running doc classname.
For more information, see “Accessing Help for Externally Supplied Class
Files”. The following example shows class information in the Help browser for
the user-created class, sads, displayed by running
doc sads
151
Version 7.7 (R2008b) MATLAB® Software
152
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
Finding Text In Small Help Windows
The Find dialog box is now available from the small help windows used for
the Help on Selection feature and for context-sensitive help. The find feature
is useful when you want to search for a specific word or phrase within one of
these help windows. To access the Find dialog box:
• In a window used for the Help on Selection feature, press Ctrl+F on
Windows and UNIX platforms or Cmd+F on Macintosh platforms. You can
also click the Find text
button
• In a context-sensitive help window, press Ctrl+F on Windows and UNIX
platforms, and Cmd+F on Macintosh platforms
For more information about the Help on Selection feature, see “Getting Help
for a Function Shown in the Command Window or Editor”.
Changes to Search Field in Help Browser
You can quickly access the Product Filter from the search field by selecting the
down arrow at the right side of the search field and from it, selecting Filter
by Product. The Help pane of the Preferences dialog box opens. For more
information about the product filter, click the Help button in the dialog box.
As you enter a term in the search field, a history of terms you previously
entered in the current session appears. To view the full history, select the
down arrow at the right side of the search field and from it, select Show
Search History. You can select an item in the search history to rerun the
search.
To execute a search, enter the search terms and press Enter. There is no
longer a Go button.
Workspace, Search Path, and File Operations
New features and changes introduced in Version 7.7 (R2008b) are:
• “Current Directory Browser Enhanced, Including New Navigation and
Grouping Features” on page 154
• “Structure Results of dir for Nonexistent Files Now Include Empty
Matrices” on page 158
153
Version 7.7 (R2008b) MATLAB® Software
• “Workspace Browser Toolbar Is Now Configurable” on page 159
• “Semicolon (;) Path Separator Character Now Used on UNIX Platforms”
on page 160
Current Directory Browser Enhanced, Including New
Navigation and Grouping Features
The Current Directory browser includes new ways to navigate and to view
the directory contents. There are also new ways to find files, including a
new filter field.
• Use the new address bar to view the current directory and to view and
navigate to subdirectories within the current directory path.
• Access common features from the Actions button
on the toolbar.
• Add and remove buttons from the toolbar by right-clicking the toolbar and
selecting Customize.
• List only files whose names contain a specified string by using the new
filter field. To show the filter field, use File > Preferences > Current
Directory.
• In the Details pane at the bottom of the tool, view a list of elements in the
selected file, such as subfunctions in a MATLAB program file. Double-click
an element to open the file at the location of the element.
• For a MAT-file, drag selected variables from the Details pane to the
Workspace browser to load them into MATLAB. Similarly, save workspace
variables to a MAT-file by dragging them from the Workspace browser
to the Current Directory browser.
• Group items in the current directory, that is, view related items together.
From the Actions button, select Group By and select the attribute you
want to group by.
Some of the major changes are highlighted in the following illustrations.
154
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
Type a string in the filter field to view only
file names containing that string
in the current directory.
Use preferences to show the filter field.
Right-click the toolbar
and select Customize to
add and remove buttons.
View
subdirectories
and change the
current directory
using the
address bar.
155
Version 7.7 (R2008b) MATLAB® Software
To group files by type, select Group By from the Actions button.
Use the - or + button to hide or show files within a group.
Here, files are grouped by type, and
files for all types except those with a .m extension are hidden.
View elements in
the selected file.
Double-click an
element to open
the file, at the
location of that
element.
For more information, see “Managing Files in MATLAB”.
Compatibility Considerations. The following aspects of using the Current
Directory browser are different in Version 7.7 (R2008b) than in the previous
version. Following is a table of what changed and the way to perform the
same action in Version 7.7.
156
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
Change
What To Do Instead In Version 7.7 (R2008b)
The toolbar no longer
includes the buttons it
previously included.
You can now specify which buttons to include
on the toolbar. You can include the toolbar
buttons included in previous versions, or use these
alternatives:
• Go up one level button — Instead, select a
directory one level up by using the address bar.
• Find files button — Instead, select Find Files
from the Actions button on the toolbar, or use
Ctrl+F.
• New folder button — Instead, select New
Folder from the Actions button on the toolbar.
• Directory reports — Instead, select Reports
from the Actions button on the toolbar.
The string display of
the full path for the
current directory has
been replaced by the
address bar view.
You can still access the string display, which can be
useful if you want to copy it or edit it directly. To
access the string, click the blank area to the right of
the last subdirectory in the address bar. To return
to the address bar view, press the Escape key.
You do not select
attributes (columns)
to display using
Current Directory
Preferences (Browser
display options).
Right-click any column header to select or clear the
columns to display, such as file size. You can only
do this on Microsoft Windows platforms.
The file description no
longer appears in a
column.
View the description for a selected file in the detail
pane.
157
Version 7.7 (R2008b) MATLAB® Software
Change
What To Do Instead In Version 7.7 (R2008b)
The full help for a
MATLAB program file
no longer appears in
the detail pane.
Press F1 to view the reference page for the selected
file.
You do not elect to
show details using
Current Directory
Preferences (Browser
display options).
Use the arrow on the right side of the detail pane
separator to show or hide the details.
The File Filter
options, accessible
from the context menu
and the View menu,
have been removed.
Use the new filter field (use Preferences for the
Current Directory browser to show the filter field),
or sort by file type (click the document icon header),
or group by file type using the new grouping
feature (available from the Actions button).
The View menu was
removed.
Use the new filter field (previously described)
to filter the view. For Directory Reports, select
Reports from the Actions button on the toolbar.
When you look for
items in the current
directory by typing
the initial letters in
the name, a pop-up
window no longer
appears showing the
letters that you typed.
As before, the first entry whose name begins with
the letters you typed is selected. If you want to see
what you type when finding items in the current
directory, instead use the filter field.
Structure Results of dir for Nonexistent Files Now Include
Empty Matrices
When you run dir with an output argument and the results include a
nonexistent file or a file that dir cannot query for some other reason, dir
now returns empty matrices for the date, bytes, and datenum fields. The
most common occurrence is on UNIX platforms when dir queries a file that
is a symbolic link and the symbolic link points to a nonexistent target. A
nonexistent target is when a target has been moved, removed, or renamed.
158
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
For example, if my_file in my_dir is a symbolic link to another file that has
been deleted, then running
r = dir('my_dir')
includes this result for my_file:
r(n) =
name: 'my_file'
date: ''
bytes: []
isdir: 0
datenum: []
where n is the index for my_file, found by searching r by the name field.
With empty matrices returned, code you write to use the results of dir can
be simpler and more robust. For more information, see the reference page
for the dir function.
Compatibility Considerations. In previous versions, dir returned
inappropriate values for files that could not be queried:
r(n) =
name: 'my_file'
date: '18-Jan-2038 22:14:07'
bytes: 0
isdir: 0
datenum: 7.4438e+05
If you have existing files that rely on the results of dir for a file that could not
be queried, your code might not produce the result it used to. If you write new
code that depends on the new results for dir and run it in a previous version
of MATLAB, it might not produce the results you expect. In either case, there
will probably not be a warning or error.
Workspace Browser Toolbar Is Now Configurable
Rearrange, add, or remove buttons and other controls from the Workspace
Browser toolbar using File > Preferences > Toolbars. Alternatively,
159
Version 7.7 (R2008b) MATLAB® Software
right-click the toolbar and select Customize from the context menu. By
default, the Print button is not on the toolbar.
For more information on customizing the toolbar, see “Setting Toolbars
Preferences for Desktop Tools”.
Semicolon (;) Path Separator Character Now Used on UNIX
Platforms
On UNIX platforms, MATLAB now uses a semicolon (;) as the character
that separates directories in the search path file, pathdef.m, which is the
character used on Windows platforms. This is beneficial if you work with the
contents of the pathdef.m file programmatically on both Windows and UNIX
platforms. In versions prior to Version 7.7 (R2008b), MATLAB used the colon
(:) character as the path separator on UNIX platforms.
Compatibility Considerations. MATLAB will continue to accept the colon
(:) character as a valid path separator on UNIX platforms, so any existing
code you have that relies on it will still work.
You will experience a problem if you have any directories that contain a
semicolon in their name. You will need to rename the directories to include
them on the search path.
Editing and Debugging MATLAB Code
New features and changes introduced in Version 7.7 (R2008b) are:
• “Create New Function and Class Files Using Templates” on page 161
• “View Syntax Hints, Find Function Names, and Get Quick Help” on page
161
• “Set Color and Width of Right-Hand Text Limit” on page 161
• “Set Cursor to First Nonwhite Character on Line” on page 162
• “Suppress a Specific M-Lint Message Throughout a File” on page 162
• “New M-Lint Message for Suppressed Messages” on page 162
• “View M-Lint Message in ToolTip Using the Keyboard” on page 162
• “Apply M-Lint Autofix Using the Keyboard” on page 163
160
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
• “Code Fold Single Program, Multiple Data (spmd) Blocks” on page 163
• “File and Directory Comparisons Tool: Highlight Changes” on page 163
• “Block Indenting Will Not Be Included in Next Version” on page 163
• “Accessing Contents of MATLAB Root Directory on Macintosh Platforms”
on page 164
Create New Function and Class Files Using Templates
When you create new functions and class definition files (classdef), you
can start with a template that reminds you to include standard information.
Select File > New > Function M-File, or File > New > Class M-File. A
new file containing template information opens in the Editor.
View Syntax Hints, Find Function Names, and Get Quick Help
While you enter statements in the Editor or Command Window, you can
display the syntax for a function in a temporary pop–up window. For more
information, see “View Syntax Hints While Entering Statements” on page 149.
You also can find the names of and get help for functions using the new
Function Browser—for more information, see “Find Function Names and Get
Help Using the New Function Browser” on page 148.
Set Color and Width of Right-Hand Text Limit
In the Editor, where you can enable a vertical line to indicate a right-hand
text limit, you now can set the width and color of the line. Note that the
default color for the line is now gray, instead of light red.
Set preferences for the line by selecting
File > Preferences > Editor/Debugger > Display, which opens the
Preferences dialog box.
Click Help in the Preferences dialog box for more information.
161
Version 7.7 (R2008b) MATLAB® Software
Set Cursor to First Nonwhite Character on Line
When you press the Home key, the cursor goes to the first nonwhite character
on the current line. When you press the Home key twice, the cursor goes
to the beginning of the line.
Compatibility Considerations. In versions prior to Version 7.7 (R2008b),
the Home key always moved the cursor to the first column of the current line.
Suppress a Specific M-Lint Message Throughout a File
You can now suppress a specific M-Lint message throughout a file by
right-clicking on an M-Lint indicator that elicits the message, and then from
the context menu, selecting Suppress All Instances in this File.
For details, see “Suppress All Instances of a Message in the Current File” in
the MATLAB Desktop Tools and Development Environment documentation.
For information on manually inserting the string that tells M-Lint to suppress
the message throughout the file, see the documentation for the mlint function.
New M-Lint Message for Suppressed Messages
An M-Lint message now appears if you previously suppressed a message
using the %#ok directive, and that message no longer appears. This
can result if the message is already suppressed using preferences
(File > Preferences > M-Lint), and the code has changed such that the
message is no longer generated, or if the rules M-Lint follows for generating
the message have changed. The new message is:
An M-Lint message was suppressed here, but the message no longer appears
Use the context menu to fix.
For an example, see the Suppressing All Messages on a Line with mlint
example in the mlint function documentation.
View M-Lint Message in ToolTip Using the Keyboard
To open an M-Lint Message ToolTip using the keyboard, place the cursor over
the marked code and press Ctrl + M. This feature is offered in addition to the
identical behavior available when you use the mouse pointer to hover over
code that is marked by M-Lint. For an example of viewing an M-Lint message
162
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
in a ToolTip, see “Code Analysis Options” in the MATLAB Desktop Tools and
Development Environment documentation.
Apply M-Lint Autofix Using the Keyboard
To fix a problem marked by M-Lint as having an automatic fix available,
place the cursor over the marked code, and then press Alt + Enter. This
feature is offered in addition to the identical behavior available when you use
the context menu. For an example of using the M-Lint autofix feature, see
“Code Analysis Options” in the MATLAB Desktop Tools and Development
Environment documentation.
Code Fold Single Program, Multiple Data (spmd) Blocks
By default, the Editor now supports code folding for single program, multiple
data (spmd) blocks. For more information on code folding, see “Code Folding
— Expanding and Collapsing File Constructs” in the MATLAB Desktop Tools
and Development Environment documentation.
File and Directory Comparisons Tool: Highlight Changes
The File and Directory Comparisons Tool now uses shades of colors to mark
differences in the contents of two directories being compared. Light colors
indicate files that differ and dark colors indicate subdirectories that differ.
For details and an example, see “Comparing Folders and ZIP Files” in the
MATLAB Desktop Tools and Development Environment documentation.
Compatibility Considerations. In releases prior to Version 7.7 (R2008b),
the same color intensity highlighted differences in both files and directories.
Block Indenting Will Not Be Included in Next Version
The Block Indent option will no longer be provided, starting in
the next version of MATLAB. Currently, this option is available
for M, Java, and C/C++ programming languages, when you select
File > Preferences > Editor/Debugger > Language. To attain the effect
of block indenting, you can use the No indent option and indent lines
manually using the Tab and space keys.
If you have concerns about the pending removal of the Block Indent option,
please e-mail Technical Support at [email protected]
163
Version 7.7 (R2008b) MATLAB® Software
Accessing Contents of MATLAB Root Directory on Macintosh
Platforms
Starting in MATLAB 7.7 (R2008b), on Macintosh platforms, you cannot use
file browser GUIs to directly access contents of the MATLAB root directory.
For example, when you use File > Open from the Editor, you cannot directly
select a file located within matlabroot. For more information, see “Contents
of MATLAB Root Directory” on page 144.
Tuning and Managing MATLAB Code Files
Access Directory Reports
You now access Directory Reports by navigating to the directory containing
the MATLAB program files for which you want to produce reports. Then, on
the Current Directory browser toolbar, click the Actions down arrow
and
select the type of report you want to run for all of the MATLAB program
files in the current directory. Note that these reports are now referred to as
Reports, rather than Directory Reports.
Compatibility Considerations. In versions prior to Version 7.7 (R2008b),
you navigated to the directory containing the MATLAB program files for
which you wanted to produce reports. Then, you clicked the Directory
Reports down arrow
on the Current Directory browser toolbar.
Publishing MATLAB Code Files
New features and changes introduced in Version 7.7 (R2008b) are:
• “Include Figure Window Details in Published Documents” on page 164
• “Inline Math Supported in Published Documents” on page 165
• “Publish Setting: Cascading Style Sheet Is Now XSL File” on page 165
Include Figure Window Details in Published Documents
In versions prior to Version 7.7 (R2008b), when you published a file that
included a figure window, only the graph or figure was included in the
published document. Using the figureSnapMethod option, you can now
164
Desktop Tools and Development Environment, MATLAB® Version 7.7 (R2008b)
specify that you want the window details included in the published document.
For details, see the publish reference page.
Inline Math Supported in Published Documents
In versions prior to Version 7.7 (R2008b), you could publish LaTeX code in a
published document as a code block, separate from the rest of your comments,
if any. Now, you can publish LaTeX math symbols inline with the rest of
your comments. For details, see “Including Inline LaTeX Math Symbols in
MATLAB Files for Publishing”.
Publish Setting: Cascading Style Sheet Is Now XSL File
In versions prior to Version 7.7 (R2008b), there was a Cascading Style
Sheet setting on the Publish Configurations dialog box (which you access by
clicking the Publish down-arrow button
). This setting is now called XSL
File, to more accurately reflect the setting.
Compatibility Considerations. The Cascading Style Sheet setting on the
Publish Configurations dialog box is now XSL File.
165
Version 7.7 (R2008b) MATLAB® Software
Mathematics, MATLAB Version 7.7 (R2008b)
New features and changes introduced in this version are:
• “Upgrade to Random Number Generator” on page 166
• “Multipoint Boundary-Value Problems with bvp5c” on page 167
• “Upgrades to lsqnonneg” on page 167
• “Functions and Properties Being Removed” on page 167
• “Upgrade to Intel Math Kernel Libraries” on page 167
Upgrade to Random Number Generator
• The randn function uses a new longer period random number algorithm as
its default.
• The new function randi returns random integers from a uniform discrete
distribution.
• The @RandStream class allows you to construct a random number stream
object and set its properties. For more information, see “Random Numbers”
in the MATLAB Mathematics documentation.
Compatibility Considerations
The randn function now produces different results than in previous releases.
Because the values returned by randn are intended to be random, this change
should not affect most code. To reproduce randn results from previous
releases use the legacy syntax. See “Legacy Random Stream” in the MATLAB
Mathematics documentation for how to use the legacy mode.
rand and randn now draw from the same random number stream. In prior
releases, rand and randn had separate independent underlying random
number streams. Since rand and randn now access the same stream, using
randn will affect subsequent values produced by rand and vice-versa. See
“Creating and Controlling a Random Number Stream” in the MATLAB
Mathematics documentation for more information.
166
Mathematics, MATLAB® Version 7.7 (R2008b)
Multipoint Boundary-Value Problems with bvp5c
The solver bvp5c will take multipoint boundary-value problems.
Upgrades to lsqnonneg
lsqnonneg now runs more efficiently. It accepts sparse matrices as inputs
and maintains sparsity throughout its internal iterations.
Functions and Properties Being Removed
Function or Property
Name
What
Happens
When
You Use
Function or
Property?
Use This Instead
Compatibility Considerations
betacore
Fails
betainc
Replace all existing instances of
betacore with betainc.
colmmd
Fails
colamd
Replace all existing instances of
colmmd with colamd.
symmmd
Fails
symamd
Replace all existing instances of
symmmd with symamd.
flops
Fails
None
Remove all instances of flops.
With the incorporation of LAPACK
in MATLAB Version 6, counting
floating-point operations is no
longer practical.
Upgrade to Intel Math Kernel Libraries
For Windows, Intel Mac®, and Linux platforms, MATLAB software supports
the Intel Math Kernel Library (MKL) version 10.0.3.
167
Version 7.7 (R2008b) MATLAB® Software
Data Analysis, MATLAB Version 7.7 (R2008b)
Specialized Data Tips for the hist Function
When you create a histogram display using hist and place data tips in the
plot in data cursor mode, they now snap to the top center of the bin you attach
them to. The data tip contents have changed as well, and now consist of:
• Number of observations falling into the selected bin
• The x-value of the bin’s center
• The lower and upper x-values for the bin
For details, see “Using Data Cursors with Histograms” in the MATLAB
Graphics documentation.
Compatibility Considerations
Data tips for histograms no longer display the x and y coordinates of their
locations and no longer snap to the four corners of the bins, as they do for bar
plots. The data tips are also larger, to accommodate the extra information.
168
Programming Fundamentals, MATLAB® Version 7.7 (R2008b)
Programming Fundamentals, MATLAB Version 7.7
(R2008b)
New features and changes introduced in this version are
• “Fast Key Lookup Provided with New Map Data Structure” on page 169
• “Tic and Toc Support Multiple Consecutive Timings” on page 170
• “New Options for MException getReport” on page 171
• “what Function Returns Package Information” on page 171
• “addtodate Accepts Hours, Minutes, Seconds, Milliseconds” on page 172
• “Querying Options Added to pause” on page 172
• “File Selection Restriction in Import Wizard” on page 173
• “Function Handle Array Warning Is Now An Error” on page 174
• “Two Types of issorted Warnings Are Now Errors” on page 175
• “Possible Conflict with New Keyword: SPMD” on page 175
• “Do Not Create MEX-Files with DLL File Extensions” on page 176
• “isequal Is Now Called Explicitly for Contained Objects” on page 176
• “Indexed Assignment with Objects of the Form p(:) = o Now Consistent
with MATLAB Language” on page 177
• “fopen No Longer Supports VAXD, VAXG, and Cray Machine Formats”
on page 177
Fast Key Lookup Provided with New Map Data
Structure
This release introduces a new MATLAB class called a Map. An object of the
Map class is an array of any MATLAB data type that supports lookup table
functionality. Unlike most arrays in MATLAB that only allow access to the
elements by means of integer indices, indices for Map containers can be
nearly any scalar numeric value or a character string.
The following example creates a Map object that is an array of strings. It is
very much like any other string array except that with each value of this array
169
Version 7.7 (R2008b) MATLAB® Software
there is also a lookup key associated with it. This particular Map contains
the names of capital cities in the United States. These are the values of the
Map object. Associated with each capital city value is the US state that it
resides in. These are the keys of the Map object. You look up values in the
Map using key indices. Call the containers.Map constructor to create an
array of six capital cities indexed by six US states. (The capital of Alaska has
purposely been entered incorrectly):
US_Capitals = containers.Map( ...
{'Arizona', 'Nebraska', 'Nevada', ...
'New York', 'Georgia', 'Alaska'}, ...
{'Phoenix', 'Lincoln', 'Carson City', ...
'Albany', 'Atlanta', 'Fairbanks'});
% 6 States
% 6 Capitals
Show the capitals of three of the states by looking them up in the Map using
the string indices 'Nevada', 'Alaska' and 'Georgia':
values(US_Capitals, {'Nevada', 'Alaska', 'Georgia'})
ans =
'Carson City'
'Fairbanks'
'Atlanta'
Correct the capital city of Alaska by overwriting the entry at string index
'Alaska':
US_Capitals('Alaska') = 'Juneau';
US_Capitals('Alaska')
ans =
Juneau
The term containers.Map refers to a Map class that is part of a MATLAB
package called containers. For more information, see Map Containers in the
Programming Fundamentals documentation.
Tic and Toc Support Multiple Consecutive Timings
The tic and toc timing functions now support multiple consecutive timings.
Call tic with an output t0 to save the current time as the starting time for
some operation. When the operation completes, call toc with the same t0 as
its input and MATLAB displays the time between that particular tic and toc.
170
Programming Fundamentals, MATLAB® Version 7.7 (R2008b)
In the following example, MATLAB measures the time used by each function
call and, at the same time, measures the time required for the overall
operation:
t0 = tic;
t1 = tic;
t2 = tic;
t3 = tic;
toc(t0)
W = myfun1(A,B);
[X,Y] = myfun2(C,W);
Z = myfun3(A,C,Y);
toc(t1)
toc(t2)
toc(t3)
You can still call tic and toc without any arguments. In this case, toc just
measures the time since the most recent tic.
See the function reference page for tic or toc for more information.
New Options for MException getReport
The MException getReport method has several new options available in
this release. You select these options when you call getReport. They give
you more control over the content and format of the information displayed
or returned by getReport.
See the function reference page for getReport for more information.
what Function Returns Package Information
The what function now includes package information in its output display and
a package field in the structure array that it returns.
List the packages used in the MathWorks Communications Toolbox™:
s = what('comm');
s.packages
ans =
'crc'
'commdevice'
'commsrc'
'commgui'
'commscope'
171
Version 7.7 (R2008b) MATLAB® Software
'commutils'
You can also call what on a specific package name to see what types of
directories and files are in the package directory.
See the function reference page for what for more information.
addtodate Accepts Hours, Minutes, Seconds,
Milliseconds
In previous releases, the addtodate function supported modifying a date
number by a specified number of years, months, or days. In this release, you
can also modify the date by a specified number of hours, minutes, seconds,
or milliseconds.
Add 2 hours, 45 minutes, and 17 seconds to the current time:
d1 = now;
datestr(d1)
ans =
12-Jun-2008 16:15:38
d2
d2
d2
d2
=
=
=
=
addtodate(d1,
addtodate(d2,
addtodate(d2,
addtodate(d2,
2, 'hour');
45, 'minute');
17, 'second');
3000, 'millisecond');
datestr(d2)
ans =
12-Jun-2008 19:00:58
See the function reference page for addtodate for more information.
Querying Options Added to pause
There are new syntaxes for the pause function:
• To see whether pausing is enabled or not, use one of the following
commands:
172
Programming Fundamentals, MATLAB® Version 7.7 (R2008b)
pause query
state = pause('query')
• To return the previous pause state when enabling or disabling pausing, use
one of the following:
oldstate = pause('on')
oldstate = pause('off')
See the function reference page for pause for more information.
File Selection Restriction in Import Wizard
This release introduces a change in how you select the source to import using
the Import Wizard. In previous releases, you could select and view the
contents of any number of files within the wizard before choosing the one to
import. As of this release, if you need to import from a different source (a
specific file or the system clipboard) than the one you had originally selected,
you must exit and restart the Import Wizard. This change gives the Import
Wizard increased flexibility in handling different types of files, removes
redundancy in the import process, and also removes a potential source of
unexpected behavior from the product.
Compatibility Considerations
The user interface to the Import Wizard is very much the same as in previous
versions of MATLAB. However, you should take note of the following changes:
• The panel named Select Data Source, that appears at the top of
the Import Wizard preview dialog box in earlier releases, is no longer
available. As before, you select the source file to import, or the clipboard,
at the time you activate the Import Wizard. This applies whether you
use File > Import Data from the MATLAB Command Window menu or
the uiimport function at the command prompt. To make a new file or
clipboard selection, click the Cancel button in any of the dialog boxes,
and then restart the Wizard.
• Calling uiimport without a file name displays the following new dialog box.
Choosing File opens the Import Data dialog box. Selecting Clipboard
opens the wizard with the contents of the clipboard in the preview panel.
173
Version 7.7 (R2008b) MATLAB® Software
• To import from the clipboard using the MATLAB menus, use Edit > Paste
to Workspace instead of using File > Import Data , and then change the
source to Clipboard. This method is preferred because it is more direct.
The capability of switching from file to clipboard within the wizard is no
longer supported.
Function Handle Array Warning Is Now An Error
The only way to make an array of function handles is to use a cell array.
Attempting to create any other type of array of function handles is invalid.
For the past several releases, MATLAB has issued a warning if you should
attempt to put function handles into any type of array other than a cell array.
As of this release, MATLAB throws an error instead of a warning when this
is attempted.
Replace
A = [@sin @cos @tan];
??? Error using ==> horzcat
Nonscalar arrays of function handles are not allowed; use cell arrays ins
with
A = {@sin @cos @tan};
Compatibility Considerations
If any of your program code attempts to create a regular array of function
handles, this code will now generate an error.
174
Programming Fundamentals, MATLAB® Version 7.7 (R2008b)
Two Types of issorted Warnings Are Now Errors
In previous versions, the issorted function generated a warning for the
following two cases:
• issorted(x), where x is a complex integer, and
• issorted(x,'rows'), where x is an ND array
Using issorted on a Complex Integer
In this case, a statement such as the following
issorted(int8(complex(1,2)))
now issues the error message
??? Error using ==> issorted
ISSORTED on complex inputs with integer class is obsolete.
Please use ISSORTED(DOUBLE(X)) or ISSORTED(SINGLE(X)) instead.
Using issorted on an N-D Array
In this case, a statement such as
issorted(ones(3,3,3),'rows')
now issues the error message
??? Error using ==> issorted
X must be a 2-D matrix.
Compatibility Considerations
If any of your program code attempts to use either of these types of
statements, this code will now generate an error.
Possible Conflict with New Keyword: SPMD
This release introduces a new keyword, spmd, that, although used solely by
the Parallel Computing Toolbox (PCT), may cause conflicts with MATLAB
175
Version 7.7 (R2008b) MATLAB® Software
users as well. See “spmd Construct” in the PCT release notes for more
information on this keyword.
Compatibility Considerations
Because spmd is a new keyword, it will conflict with any user-defined
functions or variables of the same name. If you have any code with functions
or variables named spmd, you must rename them.
Do Not Create MEX-Files with DLL File Extensions
In the future, on 32-bit Windows® systems, MATLAB will not support
MEX-files with a .dll file extension. See release note “Do Not Use DLL File
Extensions for MEX-Files” on page 185 for information on how this might
affect you.
isequal Is Now Called Explicitly for Contained Objects
When you pass two MATLAB objects to isequal, MATLAB dispatches to
the isequal method of the dominant object (see “Object Precedence in
Expressions Using Operators”). If the dominant object does not overload
isequal, then MATLAB uses the built-in version.
Compatibility Considerations
What is different with this release, is that MATLAB now calls isequal
explicitly for each contained object. This means that, if any contained object
overloads isequal, MATLAB calls the overloaded version for that object.
Previously, MATLAB compared contained objects using the built-in isequal
functionality without regard to any special behavior programmed into
overloaded isequal methods. The effect of this change is that, for objects
that contain other objects and those contained objects overload isequal, the
overloaded behavior establishes the basis with which MATLAB determines
equality for those contained objects.
176
Programming Fundamentals, MATLAB® Version 7.7 (R2008b)
Indexed Assignment with Objects of the Form p(:) =
o Now Consistent with MATLAB Language
The behavior of indexed assignment with MATLAB objects is consistent with
the behavior of all MATLAB intrinsic types and V5 MATLAB objects. For
example, attempting the following assignment, where d does not previously
exist, gives an error:
>> d(:) = 5;
??? In an assignment
must be the same.
A(:) = B, the number of elements in A and B
MATLAB objects behave in the same way:
ts_obj = timeseries;
t(:) = ts_obj;
??? In an assignment
must be the same.
A(:) = B, the number of elements in A and B
Compatibility Considerations
In MATLAB Version 7.6 Release 2008a, indexed assignment of the form p(:)
= object did not result in an error.
fopen No Longer Supports VAXD, VAXG, and Cray
Machine Formats
Calls to fopen with any of the following values for machine format return
an error:
• 'vaxd' or 'd'
• 'vaxg' or 'g'
• 'cray' or 'c'
Compatibility Considerations
In previous releases, calls to fopen with machine format values associated
with VAXD, VAXG, and Cray did not result in an error.
177
Version 7.7 (R2008b) MATLAB® Software
To read files in VAXD and VAXG formats, consider the workaround available
on the MATLAB Central File Exchange, file ID #22675.
178
Graphics and 3-D Visualization, MATLAB® Version 7.7 (R2008b)
Graphics and 3-D Visualization, MATLAB Version 7.7
(R2008b)
New features and changes introduced in this version are:
• “Certain Printer Formats and Drivers Now Warn When Used” on page 179
• “Handle Graphics Not Supported Under -nojvm Startup Option” on page
181
Certain Printer Formats and Drivers Now Warn
When Used
Going forward, MathWorks is planning to leverage existing operating system
(OS) support for printer drivers and devices. As a result, the ability to specify
certain print devices using the print -d command, and certain graphics
formats using the print -d command and/or the saveas command, will be
removed in a future release.
Graphic Format Drivers
-pkm
-pkmraw
-tifflzw
Printer Driver
print Command Option String
Canon® BubbleJet BJ10e
-dbj10e
Canon BubbleJet BJ200 color
-dbj200
Canon Color BubbleJet
BJC-70/BJC-600/BJC-4000
-dbjc600
Canon Color BubbleJet BJC-800
-dbjc800
Epson®
and compatible 9- or 24-pin
dot matrix print drivers
-depson
Epson and compatible 9-pin with
interleaved lines (triple resolution)
-deps9high
Epson LQ-2550 and compatible;
color (not supported on HP®-700)
-depsonc
Fujitsu® 3400/2400/1200
-depsonc
179
Version 7.7 (R2008b) MATLAB® Software
180
Printer Driver
print Command Option String
HP DesignJet 650C color (not
supported on Windows OS)
-ddnj650c
HP DeskJet 500
-ddjet500
HP DeskJet 500C (creates black
and white output)
-dcdjmono
HP DeskJet 500C (with 24
bit/pixel color and high-quality
Floyd-Steinberg color dithering) (not
supported on Windows OS)
-dcdjcolor
HP DeskJet 500C/540C color (not
supported on Windows OS)
-dcdj500
HP Deskjet 550C color (not
supported on Windows OS)
-dcdj550
HP DeskJet and DeskJet Plus
-ddeskjet
HP LaserJet
-dlaserjet
HP LaserJet+
-dljetplus
HP LaserJet IIP
-dljet2p
HP LaserJet III
-dljet3
HP LaserJet 4.5L and 5P
-dljet4
HP LaserJet 5 and 6
-dpxlmono
HP PaintJet color
-dpaintjet
HP PaintJet XL color
-dpjxl
HP PaintJet XL color
-dpjetxl
HP PaintJet XL300 color (not
supported on Windows OS)
-dpjxl300
Graphics and 3-D Visualization, MATLAB® Version 7.7 (R2008b)
Printer Driver
print Command Option String
HP-GL® for HP 7475A and other
compatible plotters. (Renderer
cannot be set to Z-buffer.)
-dhpgl
IBM® 9-pin Proprinter
-dibmpro
Compatibility Considerations
The following Web site provides more detailed information on the file types
that will issue warnings and how to suppress the warnings if desired, as well
as a form to provide feedback to MathWorks about your use of these options:
http://www.mathworks.com/support/contact_us/dev/obsoleteprintdevices.html
Handle Graphics Not Supported Under -nojvm
Startup Option
If you start MATLAB with matlab -nojvm (which disables Java) you will
receive a warning when you attempt to create or load figures, open GUIs,
print or capture figures using getframe.
Compatibility Considerations
For information, see “Changes to -nojvm Startup Option” on page 145 in the
Desktop Tools and Development Environment release notes.
181
Version 7.7 (R2008b) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.7 (R2008b)
New features and changes introduced in this version are:
• “Undocumented Functions Removed” on page 182
• “Handle Graphics Not Supported Under -nojvm Startup Option” on page
183
• “New Menu Options to Hide or Show GUIDE Toolbar and Status Bar”
on page 183
• “GUIDE Status Bar Now Shows Tag Property of Selected Object” on page
184
• “Four New Major GUI Examples” on page 184
Undocumented Functions Removed
The following set of deprecated functions, all of which were previously
undocumented, have been removed. Alternatives to most of them exist, which
are described.
• axlimdlg — No alternative
• cbedit — No alternative
• clruprop — Use rmappdata instead
• ctlpanel — No alternative
• edtext — Set text object’s Editing property
• extent — Get text object’s Extent property
• getuprop — Use getappdata instead
• hidegui — Set figure’s HandleVisibility property
• hthelp — Use web instead
• layout — No alternative
• matq2ws — Combine save + load or uisave + uiload
• matqdlg — Combine save + load or uisave + uiload
182
Creating Graphical User Interfaces (GUIs), MATLAB® Version 7.7 (R2008b)
• matqparse — Combine save + load or uisave + uiload
• matqueue — Combine save + load or uisave + uiload
• menubar — The string 'none'
• menuedit — No alternative
• pagedlg — Use pagesetupdlg instead
• setuprop — Use setappdata instead
• umtoggle — Set uimenu’s Checked property
• wizard — Use guide instead
• ws2matq — Combine save + load or uisave + uiload
Compatibility Considerations
If you have developed MATLAB code that uses any of the above undocumented
functions, you must remove such calls or replace them with other code, as
suggested within the above bullets.
Handle Graphics Not Supported Under -nojvm
Startup Option
If you start MATLAB with matlab -nojvm (which disables Java) you will
receive a warning when you attempt to create or load figures, open GUIs,
print, or capture figures using getframe. For more information, see “Changes
to -nojvm Startup Option” on page 145 in the Desktop Tools and Development
Environment release notes.
New Menu Options to Hide or Show GUIDE Toolbar
and Status Bar
Two new menu options in GUIDE let you hide/show the GUIDE toolbar and
status bar. By default both are visible, but you can deselect Show Toolbar,
Show Status Bar, or both from the View menu to make the layout area
larger.
183
Version 7.7 (R2008b) MATLAB® Software
Compatibility Considerations
The GUIDE Preferences option Show Toolbar is no longer available. Use
Show Toolbar from the GUIDE View menu instead.
GUIDE Status Bar Now Shows Tag Property of
Selected Object
The GUIDE Layout Editor now shows the Tag property of any object you
select, in the left corner of the status bar that runs along its bottom. This
display saves you from having to open the Property Inspector to read Tag
names. Information in the status bar is read-only; you still need to use the
Property Inspector to change a component’s Tag.
Four New Major GUI Examples
The Creating Graphical User Interface documentation has four new extensive
examples of building GUIs with GUIDE and programmatically. All of them
feature uitables, a feature introduced in R2008a, and all the GUIs plot data.
The new examples are:
• “A Working GUI with Many Components” (GUIDE)
• “GUI for Animating a 3-D View” (GUIDE)
• “GUI to Interactively Explore Data in a Table” (GUIDE)
• “GUI that Displays and Graphs Tabular Data” (programmatic)
This release includes FIG- and code files for all these examples. The
documentation discusses many of their callbacks and includes hyperlinks to
code in the code files.
184
External Interfaces/API, MATLAB® Version 7.7 (R2008b)
External Interfaces/API, MATLAB Version 7.7 (R2008b)
• “Do Not Use DLL File Extensions for MEX-Files” on page 185
• “MEX-Files Must Be Recompiled When -largeArrayDims Becomes Default
MEX Option” on page 186
• “New Compiler Support” on page 186
• “Compiler Support to Be Phased Out” on page 186
• “Use mxDestroyArray to Release Memory for mxArray” on page 187
• “New Function Displays Information about MEX Compiler Configurations”
on page 187
• “New Functions to Catch Errors in MEX-Files Replace mexSetTrapFlag”
on page 188
• ““Duplicate dylib” Warning on Macintosh Systems” on page 188
• “Microsoft® Visual Studio "X64 Compilers and Tools" Required for 64-bit
Systems” on page 188
• “Run-Time Libraries Required for Applications Built with Microsoft® Visual
Studio 2008 Compiler” on page 189
• “Do Not Use get or set Function to Manage Properties of Java Objects”
on page 189
• “COM Objects Might Display Different Number of Supported Events” on
page 189
Do Not Use DLL File Extensions for MEX-Files
In the future, on 32-bit Microsoft Windows systems, MATLAB will not support
MEX-files with a .dll file extension. In MATLAB Version 7.7 (R2008b), if
you run a MEX-file with a .dll file extension, MATLAB displays a warning.
Additionally, if you use the mex function with the -output switch to create
a MEX-file with a .dll extension, MATLAB displays a warning. If you use
the -output switch to name a MEX-file, you do not need to provide a file
extension. MATLAB automatically appends the appropriate extension. For
example, the following command creates a MEX-file named newtest.mexw32:
mex mytest.c -output newtest
185
Version 7.7 (R2008b) MATLAB® Software
Compatibility Considerations
You must recompile MEX-files with a .mexw32 file extension. This is the
default of the mex command.
MEX-Files Must Be Recompiled When
-largeArrayDims Becomes Default MEX Option
In a future version of MATLAB, the default mex command will change to use
the large-array-handling API. This means the -largeArrayDims option will
be the default. For information about migrating your MEX-files to use the
large-array-handling API, see the Technical Support solution 1-5C27B9.
Compatibility Considerations
In the near future you will be required to update your code to use the new API
and to recompile your MEX-files. You should review your source MEX-files
and mex build scripts.
New Compiler Support
MATLAB Version 7.7 (R2008b) supports these new compilers for building
MEX-files:
Microsoft Windows 64-bit and 32-bit Platforms
• Microsoft Visual Studio 2008 Express Edition
Compiler Support to Be Phased Out
The following compilers are supported in Version 7.7 (R2008b), but will not be
supported in a future version of MATLAB.
Windows (32-bit) platform
• Intel Visual Fortran Version 9.1
• Microsoft Visual Studio .NET Version 7.1
• Open Watcom Version 1.3
186
External Interfaces/API, MATLAB® Version 7.7 (R2008b)
Windows (64-bit) platforms
• Intel Visual Fortran Version 9.1
Solaris SPARC (64-bit) platform
• Sun Studio 11 cc / CC Version 5.8
• Sun Studio 11 f90 Version 8.2
Use mxDestroyArray to Release Memory for
mxArray
The documentation for the mxSetCell, mxSetField, and mxSetFieldByNumber
functions in the MATLAB C and Fortran API incorrectly instructs customers
to use mxFree to release memory for any mxArray returned by mxGetCell,
mxGetField, or mxGetFieldByNumber.
Compatibility Considerations
The correct function to use to release memory for an mxArray is
mxDestroyArray. Calling mxFree on an mxArray only frees the array header,
but does not actually free the data itself and can result in a memory leak.
To help diagnose this problem, MATLAB issues a warning if calling mxFree on
an mxArray could cause memory corruption. In future versions of MATLAB,
this condition might result in a segmentation violation.
New Function Displays Information about MEX
Compiler Configurations
The mex.getCompilerConfigurations function displays information about
the selected compiler and associated switches and options that MATLAB uses
to build a MEX-file. The selected compiler is the one you choose when you run
the mex -setup command. For more information, see “Building MEX-Files”.
187
Version 7.7 (R2008b) MATLAB® Software
New Functions to Catch Errors in MEX-Files Replace
mexSetTrapFlag
Two new MEX library functions have been added to the MATLAB C and
Fortran API.
The mexCallMATLABWithTrap function, like mexCallMATLAB, lets
you call MATLAB functions from within a MEX-file. In addition,
mexCallMATLABWithTrap lets you catch, or trap, errors. Using this function
for exception handling is more flexible that using mexCallMATLAB with the
mexSetTrapFlag function.
Likewise, the mexEvalStringWithTrap function adds error handling to the
mexEvalString function.
Compatibility Considerations
In the near future you will be required to update your MEX-files to remove
use of the mexSetTrapFlag function.
“Duplicate dylib” Warning on Macintosh Systems
When compiling MEX-files on an Apple Mac OS Version 10.5 system you can
ignore a warning about a duplicate library libz.1.dylib. The MEX-file
builds properly and runs as expected. The warning message contains the
following information:
ld: warning, duplicate dylib
Microsoft Visual Studio "X64 Compilers and Tools"
Required for 64-bit Systems
If you use Microsoft Visual Studio with MATLAB on 64-bit systems, you must
choose "X64 Compilers and Tools" when you install the following products:
• Visual Studio 2008 Express Edition
• Visual Studio 2008 Professional Edition
• Visual Studio 2005 Professional Edition
188
External Interfaces/API, MATLAB® Version 7.7 (R2008b)
Run-Time Libraries Required for Applications Built
with Microsoft Visual Studio 2008 Compiler
If you distribute a MEX-file, an engine application, or a MAT-file application
built with the Visual Studio 2008 compiler, you must provide the Visual C++
run-time libraries. These files are required to run applications developed with
Visual C++ on a computer that does not have Visual C++ 2008 installed.
For information on locating the Microsoft Visual C++ 2008 Redistributable
Package (x86), containing vcredist_x86.exe and vcredist_x64.exe, consult
your Microsoft documentation.
Do Not Use get or set Function to Manage Properties
of Java Objects
If you want to read or update a property of a Sun Java object created in
MATLAB using the Java class constructor, do not use the MATLAB get
or set functions on the property. For example, if you create a Java object
called javaObject that has a property called PropertyName, the following
commands might cause memory leaks and will be deprecated in a future
version of MATLAB:
propertyValue = get(javaObject, 'PropertyName');
set(javaObject, 'PropertyName', newValue);
Compatibility Considerations
In future versions of MATLAB, using get or set on Java objects to manage
the properties will generate an error. The correct commands to use are:
propertyValue = javaObject.getPropertyName;
javaObject.setPropertyName(newValue);
COM Objects Might Display Different Number of
Supported Events
If you use events from COM servers implementing event interface versioning,
COM objects created with MATLAB Version 7.4 (R2007a), Version 7.5
(R2007b), or Version 7.6 (R2008a) might have a different number of supported
events than COM objects created with MATLAB Version 7.7 (R2008b) or
any version prior to 7.4.
189
Version 7.7 (R2008b) MATLAB® Software
Compatibility Considerations
Calling the events (COM) function on affected types of COM server
components returns a list of events for the latest [default] interface version
which might be different from the list of events displayed by MATLAB
Version 7.4, Version 7.5, or Version 7.6.
If an event in an older COM event interface version is no longer supported
or renamed in the newer interface version, the registerevent function
generates an error when such an event is used in an .m file.
190
Version 7.6 (R2008a)
MATLAB Software
This table summarizes what’s new in Version 7.6 (R2008a):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.6
(R2008a)” on page 193
• “Mathematics, MATLAB Version 7.6 (R2008a)” on page 221
• “Data Analysis, MATLAB Version 7.6 (R2008a)” on page 223
• “Programming, MATLAB Version 7.6 (R2008a)” on page 229
• “Graphics and 3-D Visualization, MATLAB Version 7.6 (R2008a)” on page
233
191
Version 7.6 (R2008a) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.6
(R2008a)” on page 236
• “External Interfaces/API, MATLAB Version 7.6 (R2008a)” on page 240
192
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Desktop Tools and Development Environment, MATLAB
Version 7.6 (R2008a)
New features and changes introduced in this version are organized by these
topics:
• “Desktop New Features Video” on page 193
• “Startup and Shutdown” on page 193
• “Desktop” on page 197
• “Running Functions — Command Window and History” on page 199
• “Help” on page 200
• “Workspace, Search Path, and File Operations” on page 200
• “Tuning and Managing M-Files” on page 204
• “Editing and Debugging M-Files” on page 204
• “Publishing M-Files” on page 209
• “Internationalization” on page 219
Desktop New Features Video
For an overview of the major new features in the MATLAB Desktop Tools and
Development Environment area, watch this video demo. You can also access
this and other video demos by selecting the Demos tab in the Help browser,
and then selecting MATLAB > New Features in Version 7.6.
Startup and Shutdown
New features and changes introduced in Version 7.6 (R2008a) are:
• “Windows Platforms — Startup Changes, Including Use of My
Documents/MATLAB or Documents/MATLAB Directory” on page 194
• “UNIX Platforms — Startup Changes” on page 194
• “Macintosh Platforms — Startup Changes” on page 195
• “Macintosh Platforms — Define Startup Options Using New Dialog Box”
on page 195
193
Version 7.6 (R2008a) MATLAB® Software
• “Macintosh Platforms — Run Startup Diagnostics” on page 196
• “Updated Version of JVM Software on Solaris Platform” on page 196
• “Changes to Abnormal Termination Process” on page 197
Windows Platforms — Startup Changes, Including Use of My
Documents/MATLAB or Documents/MATLAB Directory
On Microsoft Windows platforms, when MATLAB starts, it automatically
adds the My Documents/MATLAB directory (or Documents/MATLAB on Windows
Vista™) to the top of the MATLAB search path. This directory is known as the
userpath. If you remove the My Documents/MATLAB (or Documents/MATLAB)
directory from the search path and save the changes, either using the Set
Path dialog box or using the rmpath and savepath functions, the MATLAB
search path will not include the userpath directory at the next startup. On
Windows platforms, the userpath is also the default startup directory.
Use the new function, userpath, to view the current value, clear the value so
the directory is not on the search path and is not the startup directory, specify
a different value, or reset the value to the default. For more information, see
“Startup Folder on Windows Platforms” and the userpath reference page.
Compatibility Considerations. In previous versions, MATLAB
automatically added the My Documents/MATLAB directory (or
Documents/MATLAB on Windows Vista platforms) to the search path upon
startup, even if you had removed it from the path and saved your changes
during the previous session.
UNIX Platforms — Startup Changes
On The Open Group UNIX platforms, when MATLAB starts, it automatically
adds the userhome/Documents/MATLAB directory to the top of the MATLAB
search path. This directory is known as the userpath. Use the new function,
userpath, to view the current value, clear the value so the directory is
not on the search path, specify a different value, or reset the value to the
default. You can also specify that userpath be the MATLAB startup directory
by setting the value for the environment variable MATLAB_USE_USERWORK
to 1 prior to startup. For more information, see “Startup Folder on Linux
Platforms” and the userpath reference page.
194
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations. In previous versions, no directories were
added to the search path upon startup.
Macintosh Platforms — Startup Changes
On Apple Macintosh platforms, when MATLAB starts, it automatically
adds the userhome/Documents/MATLAB directory to the top of the MATLAB
search path. This directory is known as the userpath. Use the new function,
userpath, to view the current value, clear the value so the directory is not on
the search path, specify a different value, or reset the value to the default. If
you start MATLAB from a shell, you can also specify that userpath be the
MATLAB startup directory by setting the value for the environment variable
MATLAB_USE_USERWORK to 1.
For more information, see “Startup Folder on Macintosh Platforms” and the
userpath reference page.
Compatibility Considerations. In previous versions, no directories were
added to the search path upon startup.
Macintosh Platforms — Define Startup Options Using New
Dialog Box
On Apple Macintosh platforms, you can specify startup options using the new
Start MATLAB Settings dialog box. The first time you start MATLAB Version
7.6 (R2008a), the Start MATLAB Settings dialog box opens automatically. It
does not open automatically on subsequent startups; to open the dialog box,
double-click Start MATLAB Settings, located in the same directory as the
MATLAB application.
You can set these options and others:
• How you will interact with MATLAB (desktop or specified shell)
• The startup directory; the default is userhome/Documents/MATLAB
• Statement MATLAB runs upon startup
You can create and save multiple startup options files, each with different
settings. For more information, see .
195
Version 7.6 (R2008a) MATLAB® Software
Macintosh Platforms — Run Startup Diagnostics
Upon startup on Macintosh platforms, MATLAB automatically runs
diagnostics to ensure your system has the required X11 and Sun Microsystems
Java applications. If there are no problems, MATLAB starts as expected.
If there is a problem, MATLAB displays a dialog box informing you of the
problem and how to address it. You can run these diagnostics manually from
the Start MATLAB Settings dialog box, using items in the Diagnostics
menu. For more information, see .
Updated Version of JVM Software on Solaris Platform
MATLAB is now using Sun Microsystems JVM Version 6 on the Sun
Microsystems Solaris platform.
196
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations. If you use a specific version of Sun
Microsystems Java with MATLAB on the Solaris platform, this change might
impact your work.
Changes to Abnormal Termination Process
When MATLAB encounters a serious problem, such as a segmentation
violation, a dialog box opens to notify you about the problem. From the dialog
box, you can close MATLAB, or try to save your work in progress before
closing.
If you try to save your work in progress, be aware that MATLAB is in an
unreliable state and you should exit MATLAB as soon as you finish saving
your work. The Command Window displays the message Please exit and
restart MATLAB to the left of the prompt, which reminds you to discontinue
use. For more information, see “Abnormal Termination”.
Compatibility Considerations. In previous versions, when MATLAB
encountered a serious problem, an error message appeared in the Command
Window that instructed you to close MATLAB.
With multithreaded computation enabled, a platform-specific dialog box
appeared, from which you immediately closed MATLAB.
Desktop
New features and changes introduced in Version 7.6 (R2008a) are:
• “Customize the MATLAB Desktop and Editor Toolbars” on page 197
• “Clear a Browser with New Method” on page 199
• “Manage Your License” on page 199
• “Check for Updates Feature Enhanced” on page 199
Customize the MATLAB Desktop and Editor Toolbars
Rearrange, add, or remove buttons and other controls from the MATLAB
desktop or Editor toolbars using File > Preferences > Toolbars.
Alternatively, right-click a toolbar and select Customize from the context
menu.
197
Version 7.6 (R2008a) MATLAB® Software
1. Select the toolbar you want to customize.
3a. To move a control, first select it.
3b. Then select
a move button
to reposition it.
2. Select the
controls you
want to
have on the
toolbar.
For more information, see “Setting Toolbars Preferences for Desktop Tools”
There are new buttons you can add to the MATLAB desktop toolbar:
• Preferences,
, which displays the Preferences dialog box, open to the
pane last used
• Demos,
, which displays the listing of Demos in the Help browser
You can also add Save All
198
and Save As
buttons to the Editor toolbar.
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
You can change the position of the toolbars within a tool, for example, putting
both the Editor and Editor cell mode toolbars next to each other instead of
stacked. To move a toolbar, grab the anchor for a toolbar, then drag the
toolbar to the new location.
Drag the toolbar anchor to move the toolbar to a different position.
Clear a Browser with New Method
Clear an open browser in MATLAB with a new close method. For
example, open a browser to display the MathWorks Web site by running
[stat,h1]=web('http://www.mathworks.com'). Then close(h1) clears
mathworks.com from that browser window. For more information, see the
reference page for the web function.
Manage Your License
You can use new licensing features to perform license management activities,
such as activating your license, deactivating your license, or updating your
license. You can also visit the License Center at the MathWorks Web site
to perform other license-related activities. Access the features by selecting
Help > Licensing.
Check for Updates Feature Enhanced
When you select Help > Check for Updates, the dialog box now allows you
to see the latest versions for all MathWorks products, or just those you install.
You can also access release notes for each product from the dialog box. For
more information, see “Check for Updates”.
Running Functions — Command Window and History
Command History Preference — Default Value Changed
The default value for the Command History preference, Save after n
commands, is now 1. This allows you to more easily rebuild your state in
199
Version 7.6 (R2008a) MATLAB® Software
MATLAB if MATLAB terminates abnormally, such as after a power failure.
For more information about this preference, see “Preferences for Command
History”.
Compatibility Considerations. Previously, the default value for the Save
after n commands preference was 5.
Help
Preferences for Help on Selection
When you click a function name in the Command Window or Editor, and
then press F1 or select Help on Selection from the context menu, the help
appears in a pop-up window by default. Now, you can specify that the help
appear in the Help browser rather than in a pop-up window via the new Help
on Selection preference. For more information, see “Specifying Where Help
from the Editor and Function Browser Displays ”.
Slight Reordering of Products in Help Browser
In the Help browser, the order of some documentation names in the Contents
pane and the Product Filter preference dialog box has changed slightly.
Documentation now appears in this order:
• Release Notes (general)
• Installation
• MATLAB
• Toolboxes and other products based on MATLAB, arranged alphabetically
• Simulink
• Blocksets and other products based on Simulink, arranged alphabetically
• Link and target products, arranged alphabetically
Workspace, Search Path, and File Operations
New features and changes introduced in Version 7.6 (R2008a) are:
200
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
• “Array Editor Renamed to Variable Editor; Offers Enhanced Support for
Structures and Classes” on page 201
• “Search Path — Changes to User Portion” on page 202
• “New Context Menu Options in Current Directory Browser” on page 203
• “File and Directory Comparisons Tool” on page 203
Array Editor Renamed to Variable Editor; Offers Enhanced
Support for Structures and Classes
The Array Editor has been renamed to the Variable Editor, which better
reflects its support for non-array data such as structures and properties.
The Variable Editor now reports, just below the toolbar, the class and size
of the selected variable. For many classes, there is also a link to help for
the class. To view a structure in the Variable Editor, double-click one of its
elements. The resulting display is much like the display of that element in
the Workspace browser, showing the Class, Value, Size, Min, Max, and other
information. For more information about the Variable Editor, see “Viewing
and Editing Workspace Variables with the Variable Editor”.
The class for the selected element is shown
(struct in this example), and includes
a link to help for that class.
Double-click an element in a structure
in the Variable Editor (S(1,1) in this example).
The element opens in its own tab,
displaying information about the data,
as is done in the Workspace browser.
to mark
Use the data brushing button on the Variable Editor toolbar
observations on graphs and then remove or save them to new variables. For
more information, see “Data Brushing for Graphs and Linked Variables”
on page 223.
201
Version 7.6 (R2008a) MATLAB® Software
The Variable Editor supports the new MATLAB class system. Double-click
an object in the Workspace browser, and it opens in the Variable Editor. The
Variable Editor displays the object, the class, and the properties of the object.
Double-click an object in
the Workspace browser and
it displays the object's
properties in the Variable Editor.
Object and class.
Properties.
Compatibility Considerations. In previous versions, the Variable Editor
was called the Array Editor. Starting in R2008a, MATLAB Version 7.6, the
tool will be referred to as the Variable Editor.
Search Path — Changes to User Portion
By default, MATLAB adds a directory to the top of the search path
upon startup, known as the userpath directory. By default, its value is
Documents/MATLAB on Windows platforms, or My Documents/MATLAB on
Windows Vista platforms. On UNIX and Macintosh platforms, the default
directory is userhome/Documents/MATLAB. Use the new function, userpath,
to specify a different directory, clear the userpath value, or reset it to the
default value. On UNIX and Macintosh platforms, you can specify additional
directories for MATLAB to add to the top of the search path upon startup
using the MATLABPATH environment variable. When you remove the userpath
portion of the search path, it clears the value for userpath and might impact
the startup directory. For related information, see “Startup and Shutdown”
on page 193. For details see “Locations for Storing Your Files” and the
userpath reference page.
202
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations. In previous versions, on Windows
platforms, MATLAB added the default directory to the search path upon
startup, even if you removed it and saved the changes to the path. On UNIX
and Macintosh platforms, MATLAB did not add a directory to the search
path on startup.
New Context Menu Options in Current Directory Browser
The context menu, which you access by right-clicking anywhere within the
Current Directory browser, provides these three new options for creating
M-files in the current directory:
• New > Blank M-File
Creates an empty M-file
• New > Function M-File
Creates an M-file with a template for writing an M-file function
• New > Class M-File
Creates an M-file with a template for writing an M-file class definition
Compatibility Considerations. The New > M-File option is replaced by
the New > Function M-File option, which has the same effect.
File and Directory Comparisons Tool
The File Comparisons tool is now called the File and Directory Comparisons
Tool. In addition to enabling you to compare lines in two text files, it now
enables you to:
• Compare variables in two MAT files
• Determine whether the contents of two binary files are the same
• Compare two directories to determine which file names are unique to each
directory
• Compare two directories to determine if files with the same name in each
directory have the same content
See “Comparing Files and Folders” for details.
203
Version 7.6 (R2008a) MATLAB® Software
Tuning and Managing M-Files
Profiling — Setting Intel Multi-Core Processors
If your system uses Intel multi-core chips, and you plan to profile using CPU
time, set the number of active CPUs to 1 before you start profiling. See “Intel
Multi-Core Processors — Setting for Most Accurate Profiling on Windows
Systems” for details.
Editing and Debugging M-Files
New features and changes introduced in Version 7.6 (R2008a) are:
• “Stand-Alone Editor No Longer Provided” on page 204
• “Run/Continue Button Now Two Separate Buttons” on page 205
• “Evaluate Entire File Button Off Toolbar by Default” on page 205
• “TLC and XML Syntax Highlighting Supported” on page 205
• “Code Folding Enhanced to Support More Language Constructs” on page
206
• “mlint Function Uses Preference Settings when Java Software is Available”
on page 206
• “New M-Lint Warning Related to the MException Class” on page 207
• “dbstop and dbclear Functions — Option to Specify File Not on Path” on
page 208
• “edit Function Can Create New File in Existing Subdirectory ” on page 209
• “Nest Cells for Rapid Code Iteration; Includes Changes to Cell
Highlighting” on page 209
Stand-Alone Editor No Longer Provided
The MATLAB stand-alone Editor (meditor.exe) is no longer provided.
Instead of the stand-alone Editor, you can use the MATLAB Editor.
204
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations. Some users have preferred the stand-alone
Editor to the MATLAB Editor because of slightly better startup performance
and because it does not require a MATLAB software license. For those
situations, you can use any text editor you have, such as UltraEdit or Emacs.
Run/Continue Button Now Two Separate Buttons
The Continue button is now separate from the Run button. Previously, the
Run button served as both the Run and Continue button.
Run button
Continue button
Compatibility Considerations. You now use the Run button to execute a
run configuration and the Continue button to continue execution of an M-file
after a breakpoint during debugging. See “Running MATLAB Files in the
Editor” and “Stepping Through a File” for details.
Evaluate Entire File Button Off Toolbar by Default
The Evaluate Entire File button,
toolbar by default.
, is no longer on the Editor Cell Mode
Compatibility Considerations. Previously, the Evaluate Entire File button
was on the Editor Cell Mode toolbar by default. You can put the Evaluate
Entire File button back on the toolbar by customizing it. See “Customize the
MATLAB Desktop and Editor Toolbars” on page 197 for more information.
TLC and XML Syntax Highlighting Supported
You can specify preferences for TLC and XML syntax highlighting
in the Editor/Debugger Language Preferences panel by selecting
File > Preferences > Editor > Language and then, in the Language
drop–down menu choosing TLC or XML/HTML.
Click Help in the Preferences dialog box for more information.
205
Version 7.6 (R2008a) MATLAB® Software
Code Folding Enhanced to Support More Language Constructs
You can enable code folding for all these programming constructs:
• Blocks of comments
• Cells used for rapid code iteration and publishing
• Class code
• Class enumeration blocks
• Class event blocks
• Class method blocks
• Class properties blocks
• For and parfor blocks
• Function and class help
• Function code
• If/else blocks
• Switch/case blocks
• Try/catch blocks
• While blocks
Prior to MATLAB Version 7.6 (R2008a), code folding was supported for
function code and function help only.
See “Code Folding — Expanding and Collapsing File Constructs” for details.
mlint Function Uses Preference Settings when Java Software is
Available
When Sun Microsystems Java software is available, the mlint function
honors the M-lint preferences that you specify using the M-Lint Preferences
dialog box (File > Preferences > M-Lint).
In addition, the ' config=settings.txt' option to the mlint function
enables you to override the current default M-Lint preferences settings
with a settings file that you previously created and saved using the M-Lint
206
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Preferences dialog box. If you use the ' config=settings.txt' option, you
must specify the full path to the file. If you prefer that m-lint ignore all
M-Lint preferences and use the factory default settings instead, specify the
' config=factory' flag. See m-lint for details.
Compatibility Considerations. Previously, the mlint function always
used the factory default settings, regardless of the M-Lint preferences that
you set. To restore that behavior, use the ' config=factory' flag on the
mlint function.
New M-Lint Warning Related to the MException Class
MATLAB Version 7.6 (R2008a) adds a new M-Lint warning related to the
MException class. This warning, along with two M-Lint warnings added
in MATLAB Version 7.5 (R2007b), intentionally make it difficult for you to
completely ignore an error without receiving an M-Lint warning. It is a
best practice to check error information even when an error is expected or
frequent, so that you can rule out unexpected situations.
The three messages are as follows—the first is the one added in MATLAB
Version 7.6 (R2008a):
• LASTERR and LASTERROR are better replaced by an identifier on
the CATCH block.
See doc CATCH.
• The value assigned here to variable 'x' might never be used.
This message appears when the code contains a catch statement that is
never used.
• TRY statement without a CATCH.
For example, suppose you want to read options from a file, options.txt,
but it is acceptable if that file is not present. You might write the following
code, expecting the read_options program to throw an error if the file is
not present:
options = {};
try
options = read_options( `options.txt' );
end
207
Version 7.6 (R2008a) MATLAB® Software
The problem with the preceding code is that the file might be present, but its
permissions may prevent the program from reading it. The program ignores
the file, and potentially confuses the user, who knows the file is there. Better
code for accomplishing the task is as follows, which assigns a structure value
to the variable err if an error is thrown in the try block. The structure value
contains information about the error that was thrown.
try
options = read_options( `options.txt' );
catch err
if strcmp( err.identifier, `Program:ReadOptions:NoOptionsFile' )
options = {};
else
rethrow( err );
end
end
Using this code, if a problem other than the “file is missing” error occurs,
MATLAB reports the error to the user. For instance, MATLAB reports an
error if the file format is incorrect, or if the file has the wrong permissions.
If you feel comfortable ignoring the errors completely, it is probably best to
use the try statement with no catch statement, and suppress the M-Lint
warnings that result. You can suppress the warnings through the M-Lint
preferences or by placing the %#ok pragma at the end of the line that triggers
the message. However, The MathWorks suggests that if you suppress an
M-Lint message, you include a comment in your code indicating why you
think it is appropriate to ignore the message.
For more information about the MException class, see the “Error Handling”
section in the MATLAB Programming Fundamentals documentation.
dbstop and dbclear Functions — Option to Specify File Not
on Path
The completenames option to the dbstop and dbclear functions enables
you to set and clear breakpoints, respectively, for M-files that are not on the
search path in MATLAB. See dbstop and dbclear for details.
208
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
edit Function Can Create New File in Existing Subdirectory
The edit function now allows you to specify a file that is not in the current
directory. If the file does not exist, the edit function creates it in the directory
you specify. However, the directory, must exist; the edit function will not
create a directory for you. See edit for details.
Nest Cells for Rapid Code Iteration; Includes Changes to Cell
Highlighting
You can nest cells in an M-file, including within functions and control
statements, such as for loops and if-then blocks. This gives you greater
control over how a published document appears. This nesting ability also
enables you to evaluate subsections of code on a finer grain. See “Nest Cells
for Finer Control” on page 212 for details.
Compatibility Consideration. With the introduction of nested cells, cells
definitions result in cell highlighting that looks different from previous
releases. See “Defining Code Cells” for details.
Publishing M-Files
New features and changes introduced in Version 7.6 (R2008a) are:
• “Publish Functions and Scripts Using Publish Configurations; Includes
Replacement of Publishing Preferences” on page 210
• “Nest Cells for Finer Control” on page 212
• “Publish Button Moved” on page 218
• “Publish Trademark Symbols” on page 218
• “Specifying Code for MATLAB Software to Evaluate with the publish
Function” on page 218
• “stopOnError Option No Longer Available with publish Function” on page
218
• “Include Snapshot of M-file Output in Published Document” on page 218
209
Version 7.6 (R2008a) MATLAB® Software
Publish Functions and Scripts Using Publish Configurations;
Includes Replacement of Publishing Preferences
In the Editor, you can now do the following when publishing M-file code:
• Specify code that you want MATLAB to evaluate before publishing the
code, including input arguments for functions
• Specify publishing settings, such as an output directory and file format,
that you can save and reuse as a group
To create a publish configuration, first open an M-file in the Editor. Then,
select File > Publish Configurations for filename > Edit Publish
Configurations for filename. In the resulting Edit M-File Configurations
dialog box, modify the MATLAB expression, specify Publish settings,
and name the publish configuration. For more information, see “Creating a
Publish Configuration for a MATLAB File”.
210
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations. Previously, preferences for publishing and
publishing images were available on the Preferences dialog box, which you
accessed by selecting File > Preferences > Editor/Debugger and then
choosing the Publishing or Publishing Images node. Now you set these
preferences when you create or update a publish configuration by using the
Publish settings options on the Edit M-file Configurations dialog box.
The Edit M-file Configurations dialog box continues to provide support for
creating configurations that enable you to run an M-file. These are now called
run configurations to differentiate them from publish configurations.
211
Version 7.6 (R2008a) MATLAB® Software
Nest Cells for Finer Control
You can nest cells in an M-file, including within functions and control
statements, such as for loops and if-then blocks. This gives you greater
control over how a published document appears. This nesting ability also
enables you to evaluate subsections of code on a finer grain when using rapid
code iteration.
You can insert white space before the double percent (%%) characters that
specify a cell break (which is also referred to as a cell divider). This helps to
improve readability of the M-file when the cell break is within indented code.
In prior releases, the %% characters had to be in the first column of the code.
The following image shows a simple example of an M-file with nested cells.
If you publish the file to HTML (reducing the size of the images), the cell
break nested within the for loop causes MATLAB to publish each iteration of
the for loop as it evaluates the code in the loop:
212
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
213
Version 7.6 (R2008a) MATLAB® Software
Similarly, the cell break within the for loop enables you to run the M-file
and experiment with the marker size value without the need to save the file
between adjustments:
For more information see “Marking Up MATLAB Code for Publishing” and
“Evaluating Subsections of Files Using Code Cells”.
Compatibility Consideration. In prior releases, the cell break characters
(%%) had to be in the first column of the code for the Editor to recognize the
characters as a cell break. This is no longer true, the Editor now recognizes
these characters as a cell break regardless of the amount of white space that
precedes them.
Furthermore, with the introduction of nested cells, inserting cell breaks in
this release has different effects than in the previous release. In the previous
release, if you inserted a cell break before a subfunction declaration, MATLAB
created two cells; one above the cell break and one below it. Now, if you insert
a cell break, MATLAB also inserts implicit cell breaks.
214
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
In the example shown, it inserts two implicit cell breaks in the subfunction
where you inserted the explicit cell break; one on the first line of the
subfunction and one on the last line of the subfunction. This results in three
cells: one containing the entire file, one containing the collatzplot_new
function, and one containing just the Collatz Problem cell title.
Nested cells are introduced to support function publishing.
215
Version 7.6 (R2008a) MATLAB® Software
Version 7.5 (R2007b)
Explicit
cell break
216
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
Version 7.6 (R2008a)
Implicit
cell break
Explicit
cell break
Implicit
cell break
See “Understanding Nested Code Cells” for details.
217
Version 7.6 (R2008a) MATLAB® Software
Publish Button Moved
The Publish button,
, is now located on the Editor toolbar.
Compatibility Considerations. Previously, the Publish button was located
on the Editor Cell Mode toolbar. Now you find it on the Editor toolbar.
Publish Trademark Symbols
If the comments in your M-file include trademarked terms, you can format
the comment to produce a trademark symbol (™) or registered trademark
symbol (®) in the published output. See “Including Trademarks in MATLAB
Files for Publishing” for details.
Specifying Code for MATLAB Software to Evaluate with the
publish Function
Use the codetoEvaluate option to the publish function to specify code that
you want MATLAB software to evaluate when it publishes an M-file. By
default, this is the code in the M-file. However, if you want, you can use this
option to specify additional code or alternative code for MATLAB to evaluate.
For example, you might want MATLAB to evaluate code that calls the M-file
that you are publishing.
stopOnError Option No Longer Available with publish Function
The stopOnError option is no longer available for the publish function.
MATLAB software will always stop when an error occurs, unless you add
code to handle the error.
Compatibility Considerations. To have MATLAB continue processing code
when an error occurs, handle the error using a try-catch statement. For
more information, see “The try-catch Statement”.
Include Snapshot of M-file Output in Published Document
You can include snapshots of output that an M-file generates within a
published document. Select Cell > Insert Text Markup > Force Snapshot.
This menu option inserts the snapnow function into your M-file code. This is
particularly useful when you have code that generates numerous images that
you want to include in the published document. See “Forcing a Snapshot of
Output in MATLAB Files for Publishing” for details.
218
Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)
The following image, for example, shows a published document that uses
this feature (with the size of the images reduced). Notice that the published
images appear after the for loop that generates them.
Internationalization
Locale Information Added to MATLAB Documentation
Information about using locale in MATLAB can be found in
“Internationalization” in the Desktop Tools and Development Environment
documentation.
219
Version 7.6 (R2008a) MATLAB® Software
Changes to Locale Database
Windows Platform Changes. On Microsoft Windows systems, users can
select the Pashto language with the Afghanistan country code. This locale
setting is ps_AF.1256.
Macintosh OS X Platform Changes. On Apple Macintosh OS X systems,
for users selecting the Chinese language and the China country code, the
locale setting is zh_CN.gb2312. The previous setting was zh_CN.GBK.
220
Mathematics, MATLAB® Version 7.6 (R2008a)
Mathematics, MATLAB Version 7.6 (R2008a)
New features and changes introduced in this version are:
• “Upgrade to BLAS Libraries” on page 221
• “Upgrade to LAPACK Library” on page 221
• “More Multithreaded Support For Elementwise Math Functions With
Warnings ” on page 221
• “New Algorithms for ldl, logm, and funm Functions” on page 221
• “Functions and Properties Being Removed” on page 222
Upgrade to BLAS Libraries
MATLAB software now uses new versions of the Basic Linear Algebra
Subroutine (BLAS) libraries. For Windows, Intel Mac, and Linux platforms,
MATLAB software supports the Intel Math Kernel Library (MKL) version
9.1. For the Solaris platform, MATLAB software uses the Sun Performance
Library from Sun Studio 12.
Upgrade to LAPACK Library
MATLAB software now uses Version 3.1.1 of the Linear Algebra Package
(LAPACK) library.
More Multithreaded Support For Elementwise Math
Functions With Warnings
Multithreaded support has been added to elementwise math functions that
may generate warnings: rdivide, ldivide, log, log2, and rem.
New Algorithms for ldl, logm, and funm Functions
The ldl, logm, and funm functions include new algorithms based on recent
numerical methods research.
221
Version 7.6 (R2008a) MATLAB® Software
Functions and Properties Being Removed
Function or Property
Name
What
Happens
When
You Use
Function or
Property?
Use This Instead
Compatibility Considerations
betacore
Errors
betainc
Replace all existing instances of
betacore with betainc.
colmmd
Errors
colamd
Replace all existing instances of
colmmd with colamd.
flops
Errors
None
Remove all existing instances of
flops. With the incorporation of
LAPACK in MATLAB version 6,
counting floating-point operations
is no longer practical.
symmmd
Errors
symamd
Replace all existing instances of
symmd with symamd.
quad8
Errors
quadl
Replace all existing instances of
quad8 with quadl.
table1
Errors
interp1 or
interp1q
Replace all existing instances of
table1 with interp1 or interp1q.
table2
Errors
interp2
Replace all existing instances of
table2 with interp2.
bessela
Errors
besselj
Replace all existing instances of
bessela with besselj.
beta using three input
arguments
Errors
betainc using
three input
arguments
Replace all existing instances of
beta using three input arguments
with betainc using three input
arguments.
222
Data Analysis, MATLAB® Version 7.6 (R2008a)
Data Analysis, MATLAB Version 7.6 (R2008a)
New features and changes follow.
Data Brushing for Graphs and Linked Variables
• “Data Brushing Tool” on page 225
• “Data Brushing API” on page 226
• “Data Linking Tool” on page 226
• “Data Linking API” on page 227
• “Compatibility Considerations” on page 227
This release introduces two new interactive tools for data exploration:
• Data brushing — For marking observations on graphs, allowing you to
remove or save them to new variables
• Data linking — For connecting graphs with data sources (workspace
variables) to automatically and interactively update them
In addition, figure windows have a new banner, called the linking and
brushing message bar. By default, when you plot data into a figure (i.e., add
axes), an informational banner appears across top of the figure that looks
like this.
In the figure’s message bar, click the first two links to read about these new
tools. Click the Play video link to open a nine-minute video tutorial about
the tools in a browser window (the video also describes new GUI-building
features.) To dismiss the banner, click the X. Once you do, the banner only
reappears on subsequent plots if you select Show linking and brushing
message bar in the MATLAB Preferences Confirmation Dialogs panel.
223
Version 7.6 (R2008a) MATLAB® Software
Note The linking and brushing message bar can obscure a plot’s title. Also, if
you do not dismiss the message bar, it is visible in images of figures captured
with getframe, but it does not print. See “Compatibility Considerations” on
page 227 for details.
Use data brushing when you want to isolate observations in a 2-D or 3-D
graph for separate analysis, or to remove outliers or noisy data points. Data
brushing can be applied to most graphs (some plot types do not support
brushing). Data brushing is an exclusive, persistent mode. That is, when
using it, you cannot use other figure tools, but the results of brushing data
persist when you select a different tool or no tool.
Use data linking to make plots dynamically respond to changes in the
variables they plot. Data linking applies to most graphs with identifiable
data sources and operates at the figure level. Data linking is not modal and
persists until you toggle it off or the connection between a plot and its data
sources is broken.
The two tools work smoothly together and with the Variable Editor to visually
highlight brushed observations and the data values they represent:
• Brushing data-linked observations on a graph highlights them on other
graphs that display them.
• Brushing highlights values in the Variable Editor when a brushed variable
is displayed there.
• Using the Brush tool in the Variable Editor highlights values you brush
that appear in linked plots.
• Changing values of variables causes linked graphs displaying them to
update with the changes.
• Clearing variables disconnects them from all linked figures displaying
graphs of them
You can modify variables from the command line, the Variable Editor, or with
M-files. When used within functions, data linking operates in the function’s
workspace, not the base workspace. This is also the case when debugging.
224
Data Analysis, MATLAB® Version 7.6 (R2008a)
Data Brushing Tool
All figure windows that contain axes now include a data brushing tool (the
Brush/Select data icon
) that lets you enter and exit brushing mode
and select a color with which to brush observations. The tool draws selection
rectangles (in 2-D plots) or prisms (in 3-D plots) and permits you to select
discontiguous regions and negate previously brushed observations. Undo
is also supported.
The Brush/Select data tool is a “split button” control with a brush icon on
the left and a drop-down color palette on the right. When you depress the
brush icon, you are in brushing mode; all data observations you select are
highlighted with the current brush color. The figures below illustrate these
operations.
If you leave data brushing mode to zoom, pan, or edit the plot, all brushed
observations remain highlighted. You can then reenter brushing mode and
pick up where you left off. Brush marks are not preserved when you save a
figure and reopen it from the FIG-file, however.
225
Version 7.6 (R2008a) MATLAB® Software
Data Brushing API
Use the brush function to turn brushing on and off, and to select a color for
brushing graphs. You can change brush colors on the fly with either the API
or with the Brush tool.
Data Linking Tool
All figure windows that contain axes now include a data linking tool (the
Linked Plots button
) to toggle linked mode on and off (the default).
When you toggle it on, an information bar appears underneath the lowest
toolbar on the figure, as shown below. It displays what variables are linked to
each series (data sources for x-, y-, and z- data in the graphs).
226
Data Analysis, MATLAB® Version 7.6 (R2008a)
On the left side of the information bar is a drop-down menu
that displays
the symbolism and identifies the data source for each series currently linked.
On the right side is an Edit button that opens the Data Source Properties
dialog box in which you can set display names and data sources. Usually it
is possible to unambiguously determine what data sources a graph has, but
sometimes you need to indicate what data source to use, for example, when
you plot a subrange of a data array. The information bar explains that you
need to do this as soon as you turn on data linking; then, you can open the
Data Source Properties dialog box to identify your data source(s).
Data Linking API
Use the linkdata function to turn data linking on or off for the current figure
or for a figure for which you supply a handle.
Compatibility Considerations
If you capture figure windows with the getframe function, their images
will include the message bar if the figures being captured possess them. To
prevent this from happening, click the X on the right side of the message bar
to dismiss it before calling getframe. Subsequent figures will not display a
message bar. If you want to restore the message bar at a later time, select
Show linking and brushing message bar in the MATLAB Preferences
Confirmation Dialogs panel.
227
Version 7.6 (R2008a) MATLAB® Software
If the figure has a title, its Linked Plots/Data Brushing message bar can
obscure it. This is the case for figures at the default size. Remove the message
bar if you want a title to display.
228
Programming, MATLAB® Version 7.6 (R2008a)
Programming, MATLAB Version 7.6 (R2008a)
New features and changes introduced in this version are
• “Multithreaded Computations Enabled” on page 229
• “Enhancements to Object-Oriented Programming Capabilities” on page 229
• “Packages for Classes and Functions” on page 230
• “Clear Variables with Exceptions” on page 230
• “Information on the State of Memory” on page 230
• “Define Your Own Function Cleanup Tasks” on page 231
• “New Functions” on page 231
• “Extended JIT Support” on page 231
• “Enhancements to Image Information and Writing Functions” on page 231
• “Compression of -v7.3 MAT-Files” on page 232
• “Changes to Programming Documentation” on page 232
Multithreaded Computations Enabled
Multithreaded computations, introduced in R2007a, are now on by default.
Compatibility Considerations
To disable multithreaded computations, open the Preferences dialog, choose
Multithreading, and then disable it explicitly.
Enhancements to Object-Oriented Programming
Capabilities
Major enhancements to object oriented programming capabilities enables
easier development and maintenance of large applications and data
structures.
New features include:
229
Version 7.6 (R2008a) MATLAB® Software
• The new classdef keyword enables you to define properties, methods, and
events in a class definition file. See “Class Overview”.
• A new handle class with reference behavior enables you to create more
sophisticated data structures, such as linked lists and to manage external
resources, such as files. See “Comparing Handle and Value Classes”.
• Events and listeners enable you to monitoring object property changes and
other actions. See “Events — Sending and Responding to Messages”.
• Packages enable scoping of classes and functions. See “Scoping Classes
with Packages”.
• Meta-classes provide support for class introspection. See “Obtaining
Information About Classes from Meta-Classes”.
• JIT/Accelerator support provides significantly improved performance over
the previous object oriented-programming system.
For a full description of object-oriented features, see Object-Oriented
Programming.
Packages for Classes and Functions
This release provides the capability to manage name space by placing classes
and functions in packages.
Clear Variables with Exceptions
With the new clearvars function, you can specify which variables you do not
want cleared from memory.
Information on the State of Memory
The new memory function provides memory usage information such as largest
block available, allowing you to diagnose memory problems on Microsoft
Windows platforms.
Compatibility Considerations
The memory function existed in previous versions of MATLAB, but its
purpose has changed. Previously, memory provided help text on how to free
additional memory space for your MATLAB application. The function now
230
Programming, MATLAB® Version 7.6 (R2008a)
returns information on the current state of memory use and availability in
your system.
Define Your Own Function Cleanup Tasks
With the new onCleanup function, you can specify one or more tasks for
MATLAB to perform just before exiting the current function.
New Functions
Name
Description
clearvars
Clear variables from memory
memory
Display memory information
onCleanup
Cleanup tasks at function completion
Extended JIT Support
JIT/Accelerator support now extends to statements executed at the MATLAB
Command Line and in cell mode in the MATLAB Editor. This provides
improved performance in these environments.
Enhancements to Image Information and Writing
Functions
The image information and writing functions have the following
enhancements:
• imfinfo can now return Exif data for JPEG or TIFF format image
files. Information specific to the digital camera can be found in the
'DigitalCamera' field, while any global positioning system information
can be found in the 'GPSInfo' field.
• imwrite now supports the 'RowsPerStrip' parameter that you can use
to specify how many image rows to include in a strip when writing TIFF
files. By default, imwrite limits the number of rows included in a strip
so that the size of the strip does not exceed 8 KB. Now you can specify
strips of larger size.
231
Version 7.6 (R2008a) MATLAB® Software
Compression of -v7.3 MAT-Files
You can store data items that are over 2 gigabytes in size in a MAT-file
using the -v7.3 option for the save function. This option was introduced
in MATLAB R2006b. With MATLAB R2008a, save now compresses these
MAT-files.
Changes to Programming Documentation
Some of the chapters in the MATLAB Programming documentation have
been moved or renamed in this release. Also the title of the Programming
documentation has been changed to Programming Fundamentals in order to
differentiate this part of the MATLAB help from the new documentation on
Developing MATLAB Classes.
232
Graphics and 3-D Visualization, MATLAB® Version 7.6 (R2008a)
Graphics and 3-D Visualization, MATLAB Version 7.6
(R2008a)
New features and changes introduced in this version are:
• “New Figure Toolbar Buttons” on page 233
• ““v6” Plotting Option Update — Affected Functions” on page 233
New Figure Toolbar Buttons
Two new toolbar buttons and an information bar have been added in this
release that control the new Data Brushing and Data Linking tools. Brushing
and linking let you interactively explore and analyze data.
By default, now when you create axes or plot something into a blank figure,
an informational banner appears across top of the figure with links to
documentation for data brushing and linking capabilities. You can dismiss
it by clicking the X button on right-hand side of the message bar. Once you
dismiss it, subsequent figures will not display the banner unless you select
Show linking and brushing message bar in the MATLAB Preferences
Confirmation Dialogs panel.
For more information, see “Data Brushing for Graphs and Linked Variables”
on page 223 in the Data Analysis release notes and “Interactive Data
Exploration” in the Data Analysis documentation. Also view the video tutorial
that describes these and other new features.
“v6” Plotting Option Update — Affected Functions
The Version 7.5 (R2007b) release note “The “v6” Option for Creating Plot
Objects is Obsolete” on page 286 identified plotting functions that accept the
v6 option, which is now obsolete and will be removed in a future version of
MATLAB. There is no change to the status of these functions in R2008a.
However, the list of affected functions in the R2007b release note had errors
and omissions. Below is the correct list of functions that support the option in
their syntax and now warn when it is used:
• area
• bar
233
Version 7.6 (R2008a) MATLAB® Software
• barh
• colorbar
• contour
• contourf
• errorbar
• legend
• loglog
• mesh
• plot
• plot3
• quiver
• quiver3
• scatter
• scatter3
• semilogx
• semilogy
• stairs
• stem
• stem3
• subplot
• surf
Note that the updated list adds functions plot3 and quiver3.
In the earlier release note, the following functions were incorrectly identified
as accepting the v6 option:
• meshc
• meshz
234
Graphics and 3-D Visualization, MATLAB® Version 7.6 (R2008a)
• surfc
These functions do not call v6 code and are not affected by it becoming
obsolete.
Compatibility Considerations
Specifying the v6 flag to any plotting function now results in a warning that
the option is being removed, but the option still functions. To generate a
FIG-file for a plot created with the v6 option, you still need to use the -v6
option to the hgsave command in order to save it in a form that a previous
version of MATLAB can read. Figures containing annotations (such as
textboxes, arrows, ovals, and rectangles) that are saved this way open in
previous versions, but the annotations do not display because different objects
are used to contain them in Version 7 than before. That is, the annotation
objects have never been backward compatible.
235
Version 7.6 (R2008a) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.6 (R2008a)
New features and changes introduced in this version are:
• “New GUI Table Component ” on page 236
• “Event Data Input to GUIDE Callbacks” on page 236
• “uigetfile and uiputfile Support of ’.’, ’..’, and ’/’” on page 237
• “hidegui Function Being Obsoleted” on page 237
• “Changes to How uicontrols Set Figure SelectionType” on page 237
New GUI Table Component
The new uitable component allows you to show data in a table. This
component replaces the undocumented MATLAB uitable implementation.
If you are using the old uitable component, please refer to the “uitable
Migration Document” for help migrating to the supported uitable component.
Event Data Input to GUIDE Callbacks
Auto-generated callbacks of GUIDE GUIs can now access event data for
Handle Graphics callbacks. The following Handle Graphics callbacks provide
event data when triggered:
• KeyPressFcn in uicontrol and figure
• KeyReleaseFcn in figure
• SelectionChangeFcn in uibuttonGroup
• WindowKeyPressFcn in figure
• WindowKeyReleaseFcn in figure
• WindowScrollWheelFcn in figure
• CellEditCallback in uitable
• CellSelectionCallback in uitable
236
Creating Graphical User Interfaces (GUIs), MATLAB® Version 7.6 (R2008a)
For example, the event data for keypress provides information on the key that
is pressed. See the Callback Templates documentation for more information.
uigetfile and uiputfile Support of ’.’, ’..’, and ’/’
Starting in R2007b, the uigetfile and uiputfile functions interpret '.',
'..', and '/' the same way as does the cd command. '.' is interpreted
as the current directory, '..' is the directory above the current directory,
and '/' is the top level directory. When specifying a directory rather than a
filename for either the Filterspec or DefaultName argument, you no longer
need to end the string with a '/'. However, such strings ending with a '/'
are interpreted as they were in previous releases.
hidegui Function Being Obsoleted
The hidegui function is being obsoleted and will be removed in a future
version. Instead of this function use the set function to set the figure
handle’s handlevisibility property to on or off:
set(figurehandle, `handlevisibility', 'on')
Changes to How uicontrols Set Figure SelectionType
SelectionType is a figure property that user interface components set when
you click them. It is a read-only property that describes the gesture used when
clicking the most recently selected object. For single mouse clicks, components
no longer set the figure SelectionType property to anything but 'normal'
when they are enabled. By default, all components are enabled (their Enable
property is 'on'). Previously, enabled components responded to modifier keys
(Ctrl, Alt, Shift, and Cmd) by setting SelectionType to 'alt' or 'extend'.
Now all key modifiers set SelectionType to 'normal' for UI components.
Disabled components (those with their Enable property set to 'off') set
SelectionType to 'alt' or 'extend' in response to modifier keys.
When Enable is 'on', the control is active and your Callback responds
to clicks. When Enable is 'off', the control is not active, and your
ButtonDownFcn responds to clicks. You can provide components with a
ButtonDownFcn to detect changes in SelectionType.
237
Version 7.6 (R2008a) MATLAB® Software
An additional change affects how list box uicontrol components respond to
double-clicking. The second of two successive clicks sets the SelectionType
property of an enabled list box to 'open'. Other types of uicontrols set their
SelectionType to 'normal' after both the first and the second clicks unless
key modifiers were used.
The following table describes the click responses for uicontrol components.
Enable
Status
Mouse Button
Pressed
on
SelectionType
on First Click
SelectionType
on Second Click
left
'normal'
'normal'
on
right
'alt'
'open'
on
left
Ctrl
'normal'
'normal'
on
right
Ctrl
'alt'
'open'
on
left
Shift
'normal'
'normal'
on
right
Shift
'extend'
'open'
off
left
'normal'
'open'
off
right
'alt'
'open'
off
left
Ctrl
'alt'
'open'
off
right
Ctrl
'alt'
'open'
off
left
Shift
'extend'
'open'
off
right
Shift
'extend'
'open'
*
Key Modifier
Pressed
*
*
*
Double-click result is 'open' for list boxes.
For a two-button mouse, pressing the left and right buttons together (without
key modifiers) can set SelectionType to either 'normal' or 'extend'; the
results are unpredictable, possibly depending on which button you actually
depressed first.
uipushtool and uitoggletool toolbar buttons do not set SelectionType
at all, no matter what keys or mouse buttons you press. When they are
disabled, uipushtool and uitoggletool controls do not execute their
ClickedCallback (or OnCallback/OffCallback), nor does using them trigger
a WindowButtonDownFcn callback.
238
Creating Graphical User Interfaces (GUIs), MATLAB® Version 7.6 (R2008a)
Compatibility Considerations
If your callback code depends on the value for SelectionType, be aware that
for the left mouse button, pressing Ctrl no longer sets it to 'alt' and that
Shift-clicking no longer sets it to 'extend'.
The SelectionType behavior for the right mouse button has not changed.
239
Version 7.6 (R2008a) MATLAB® Software
External Interfaces/API, MATLAB Version 7.6 (R2008a)
• “Interface to Generic DLLs Supported on 64-bit Platforms” on page 240
• “Changes to Compiler Support” on page 240
• “New Version of Perl on Windows Platforms” on page 242
• “Rebuild MEX-Files Created on Linux Platforms” on page 242
• “Use mxDestroyArray to Release Memory for mxArray” on page 243
• “Do Not Use get or set Function to Manage Properties of Java Objects”
on page 243
• “New mxArray Functions for Use with MATLAB Class Objects” on page 244
• “mex.bat File Removed from matlabroot\bin\$ARCH” on page 244
• “Run-time Libraries Required for Applications Built with Microsoft® Visual
Studio 2008 Compiler” on page 244
• “Environment Variables Required with Intel Visual Fortran 9.0” on page
245
• “-largeArrayDims Option to MEX Will Become Default” on page 245
• “Changes to Dynamic Data Exchange (DDE) Documentation” on page 246
Interface to Generic DLLs Supported on 64-bit
Platforms
The ability to load a generic DLL on 64-bit platforms using loadlibrary is
available in MATLAB Version 7.6 (R2008a).
Compatibility Considerations
You must install a C compiler and Perl to use this feature. For a list of
supported compilers and how to install them, see “Using loadlibrary on 64-Bit
Platforms”.
Changes to Compiler Support
The set of compilers that MATLAB supports has changed in MATLAB Version
7.6 (R2008a). For an up-to-date list of supported compilers, see the Supported
and Compatible Compilers Web page.
240
External Interfaces/API, MATLAB® Version 7.6 (R2008a)
• “New Compiler Support” on page 241
• “Discontinued Compiler Support” on page 241
• “Compiler Support to Be Phased Out” on page 242
New Compiler Support
MATLAB Version 7.6 (R2008a) supports new compilers for building MEX-files.
Microsoft Windows (64-bit) platform.
• Microsoft Visual Studio 2008
• Windows SDK for Vista
• Intel Visual Fortran 10.1
Windows (32-bit) platform.
• Microsoft Visual Studio 2008
• Open Watcom Version 1.7
• Intel Visual Fortran 10.1
Sun Solaris SPARC (64-bit) platform.
• Sun Studio 12 cc / CC Version 5.9
Macintosh (Intel-based 32-bit) platforms.
• Apple Xcode 3.0 (gcc / g++ Version 4.0.1)
Discontinued Compiler Support
The following compilers are no longer supported.
Windows platforms.
• Intel C++ Version 7.1
• Intel Visual Fortran Version 9.0
241
Version 7.6 (R2008a) MATLAB® Software
• Borland® C++Builder® 6 Version 5.6
• Borland C++Builder 5 Version 5.5
• Borland® C++ Compiler Version 5.5
• Compaq Visual Fortran Version 6.1
• Compaq Visual Fortran Version 6.6
Compatibility Considerations. To ensure continued support for building
your C/C++ programs, consider upgrading to another supported compiler. For
an up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
Compiler Support to Be Phased Out
The following compilers are supported in Version 7.6 (R2008a), but will not be
supported in a future version of MATLAB.
Windows (32-bit) platform.
• Open Watcom Version 1.3
Solaris SPARC (64-bit) platform.
• Sun Studio 11 cc / CC Version 5.8
New Version of Perl on Windows Platforms
MATLAB Version 7.6 (R2008a) includes Perl on Windows Version 5.8.8.
Compatibility Considerations
Prior to this release, MATLAB contained Perl Version 5.005. Consult your
Perl documentation for details on the changes between Perl versions.
Rebuild MEX-Files Created on Linux Platforms
MATLAB V7.6 (R2008a) on Linus Torvalds’ Linux platforms is built with a
compiler that utilizes glibc Version 2.3.6.
242
External Interfaces/API, MATLAB® Version 7.6 (R2008a)
Compatibility Considerations
To work with MATLAB V7.6 (R2008a), MEX-files compiled on a Linux
platform must be rebuilt.
Use mxDestroyArray to Release Memory for
mxArray
The documentation for the mxSetCell, mxSetField, and mxSetFieldByNumber
functions in the MATLAB C and Fortran API incorrectly instructs customers
to use mxFree to release memory for any mxArray returned by mxGetCell,
mxGetField, or mxGetFieldByNumber.
Compatibility Considerations
The correct function to use is mxDestroyArray. Calling mxFree on an mxArray
only frees the array header, but does not actually free the data itself and
can result in a memory leak.
To help diagnose this problem, MATLAB issues a warning if calling mxFree
on an mxArray could cause memory corruption. In future versions of
MATLAB, this condition may result in a segmentation violation.
Do Not Use get or set Function to Manage Properties
of Java Objects
If you want to read or update a property of a Sun Java object created in
MATLAB using the Java class constructor, do not use the MATLAB get
or set functions on the property. For example, if you create a Java object
called javaObject that has a property called PropertyName, the following
commands may cause memory leaks and will be deprecated in a future
version of MATLAB:
propertyValue = get(javaObject, 'PropertyName');
set(javaObject, 'PropertyName', newValue);
Compatibility Considerations
The correct commands to use are:
243
Version 7.6 (R2008a) MATLAB® Software
propertyValue = javaObject.getPropertyName;
javaObject.setPropertyName(newValue);
In future versions of MATLAB, using get or set on Java objects to manage
the properties will generate an error.
New mxArray Functions for Use with MATLAB Class
Objects
You can read and modify properties of MATLAB class objects using the
mxGetProperty and mxSetProperty functions.
mex.bat File Removed from matlabroot\bin\$ARCH
Beginning with MATLAB Version 7.3 (R2006b), the Windows script mex.bat
is located in the directory matlabroot\bin. Copies of this file were also in
the directory matlabroot\bin\$ARCH. In MATLAB Version 7.6 (R2008a),
mex.bat is only located in matlabroot\bin.
Compatibility Considerations
If you did not make the updates described in “Location of mex.bat File
Changed” on page 391, you may need to make changes now.
Run-time Libraries Required for Applications Built
with Microsoft Visual Studio 2008 Compiler
If you distribute a MEX-file, an engine application, or a MAT-file application
built with the Visual Studio 2008 compiler, you must provide the Visual C++
run-time libraries. These files are required to run applications developed with
Visual C++ on a computer that does not have Visual C++ 2008 installed.
For information on locating the Microsoft Visual C++ 2008 Redistributable
Package (x86), containing vcredist_x86.exe and vcredist_x64.exe, consult
your Microsoft documentation.
244
External Interfaces/API, MATLAB® Version 7.6 (R2008a)
Environment Variables Required with Intel Visual
Fortran 9.0
When you build a MEX-file, an engine application, or a MAT application using
Intel Visual Fortran 9.0, MATLAB requires that you define an environment
variable for the Windows platform you are using.
Windows (32-bit) platform
Define the environment variable VS71COMNTOOLS. The value of this
environment variable is the path to the Common7\Tools directory of
the Microsoft Visual Studio .NET 2002 or 2003 installation directory.
(Intel Visual Fortran requires Visual Studio .NET 2002 or 2003 on 32-bit
Windows platforms.) The Visual Studio .NET 2003 installation program
commonly defines this environment variable. For example, you might set
the environment variable as follows:
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
Windows x64 platform
Define the environment variable MSSdk. The value of this environment
variable is the path to the installation directory for Microsoft Platform
SDK for Windows Server® 2003. (Intel Visual Fortran requires Microsoft
Platform SDK for Windows Server 2003 on Windows x64 platforms.) The
Microsoft Platform SDK installation program does not commonly define this
environment variable. For example, the environment variable might have
the value
C:\Program Files\Microsoft Platform SDK
-largeArrayDims Option to MEX Will Become Default
In a future version of MATLAB, the default mex command will change to use
the large-array-handling API. This means the -largeArrayDims option will
be the default. For information about migrating your MEX-files to use the
large-array-handling API, see the Technical Support solution 1-5C27B9.
Compatibility Considerations
In the near future you will be required to update your code to utilize the new
API. You should review your source MEX-files and mex build scripts.
245
Version 7.6 (R2008a) MATLAB® Software
Changes to Dynamic Data Exchange (DDE)
Documentation
In MATLAB Version 5.1, all development work for the Dynamic Data
Exchange (DDE) server and client was stopped. MathWorks provides,
instead, a MATLAB interface to COM technology that is documented in “COM
Support for MATLAB Software”.
Obsolete Functionality No Longer Documented
Documentation for the following functions no longer included in External
Interfaces.
Obsolete Functions
ddeadv
ddeexec
ddeinit
ddepoke
ddereq
ddeterm
ddeunadv
The following syntax for enableservice no longer included in External
Interfaces.
enableservice('DDEServer',enable)
Compatibility Considerations. If you must support this obsolete
functionality, we suggest you print and keep a copy of the relevant MATLAB
function reference pages from V7.5 (R2007b) or earlier.
246
Version 7.5 (R2007b)
MATLAB Software
This table summarizes what’s new in Version 7.5 (R2007b):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.5
(R2007b)” on page 249
• “Mathematics, MATLAB Version 7.5 (R2007b)” on page 269
• “Data Analysis, MATLAB Version 7.5 (R2007b)” on page 273
• “Programming, MATLAB Version 7.5 (R2007b)” on page 274
• “Graphics and 3-D Visualization, MATLAB Version 7.5 (R2007b)” on page
283
247
Version 7.5 (R2007b) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.5
(R2007b)” on page 288
• “External Interfaces/API, MATLAB Version 7.5 (R2007b)” on page 292
248
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
Desktop Tools and Development Environment, MATLAB
Version 7.5 (R2007b)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 249
• “Desktop” on page 250
• “Running Functions — Command Window and History” on page 253
• “Help” on page 254
• “Editing and Debugging M-Files” on page 259
• “Publishing Results” on page 267
Startup and Shutdown
Windows Platforms Startup Changes
You can now change the MATLAB startup directory on Microsoft
Windows platforms using the standard shortcut Start in field. The My
Documents\MATLAB subfolder (or Documents\MATLAB on the Microsoft
Windows Vista platform) is the default startup directory. Upon startup,
MATLAB automatically creates a My Documents\MATLAB subfolder (or
Documents\MATLAB on the Windows Vista platform) if it does not exist,
and adds it to the top of the MATLAB search path. To change the startup
directory:
1 Right-click the MATLAB shortcut icon and select Properties from the
context menu. The MATLAB Properties dialog box opens to the Shortcut
pane.
2 In the Start in field, specify the directory in which you want MATLAB to
start, for example, C:\My MATLAB Place.
You can specify the directory via a UNC path (that is, the path can begin
with \\).
249
Version 7.5 (R2007b) MATLAB® Software
The Target field specifies the full path to the file to start MATLAB,
matlab.exe, located in the bin folder (for example, C:\Program
Files\MATLAB\R2007b\bin\matlab.exe). Use the bin\matlab.exe to
start MATLAB instead of matlab.bat or matlab.exe located in a platform
directory such as bin\win32. The bin\matlab.exe detects the Windows
platform and ensures required run-time files are installed.
Compatibility Considerations. The Target field no longer contains the -sd
$documents startup option. In MATLAB Version 7.4 (R2007a), the startup
directory was specified via the -sd startup option in the Target field. You
had to specify the directory via a mapped drive. Any value in the Start in
field was ignored.
The file to start MATLAB, as specified in the Target field, was matlab.bat.
Change any scripts you use to start MATLAB to specify the full path to
bin\matlab.exe. If you use matlab.bat in R2007b, MATLAB issues a
warning message instructing you to use matlab.exe instead.
If scripts include the -sd startup option to specify the startup directory, that
will be the startup directory, even if a directory is specified in the Start in
field.
Desktop
New features and changes introduced in Version 7.5 (R2007b) are:
• “Minimizing Tools in the Desktop Now Supported on Macintosh Platforms”
on page 251
• “Double-Click to Maximize or Restore Minimized Tools in Desktop” on
page 251
• “New Desktop Layout — All but Command Window Minimized” on page 251
• “Start Button Now Includes New Category for Links and Targets” on page
252
• “Start Button — View Source Files Renamed” on page 253
• “Changes to Look of Buttons in Desktop and Other Tools” on page 253
250
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
• “Antialiasing Option No Longer Necessary on Windows and Macintosh
Platforms” on page 253
Minimizing Tools in the Desktop Now Supported on Macintosh
Platforms
You can now minimize tools in the desktop on Apple Macintosh platforms. It
was introduced for other platforms in a previous version.
Double-Click to Maximize or Restore Minimized Tools in
Desktop
After you minimize a tool within the desktop, you can now:
• Restore the tool to its former position by double-clicking the button.
• Drag a button to move its position—drag it to another edge of the desktop
or to a new position within the edge where it’s currently located.
• Restore the tool by dragging the button to a location within the desktop, or
outside the desktop to undock the tool.
Similarly, you can double-click a tool’s title bar to maximize the tool in
the desktop; then double-click the title bar again to restore it to its former
position. (The capability was introduced in R2007a, MATLAB Version 7.4).
For more information, see “Opening and Arranging Desktop Tools” and
“Minimized Tools in Desktop Example”.
New Desktop Layout — All but Command Window Minimized
Select Desktop > Desktop Layout > All but Command Window
Minimized to arrange the desktop as shown here. The Command Window is
open in the desktop, and all other desktop tools are open, but minimized.
251
Version 7.5 (R2007b) MATLAB® Software
Start Button Now Includes New Category for Links and Targets
In the Start button, there is a new category for Link and Target products.
Select Start > Links and Targets, and then select one of the products.
In previous versions, you accessed these products from the Toolboxes or
Simulink software categories.
You also use this new category when running demos, or accessing Demos
or Contents in the Help browser. For more information, see “Demos and
Help Browser Contents Now Include New Category for Links and Targets”
on page 254.
252
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
Start Button — View Source Files Renamed
To add your own toolboxes to the Start button, select Start > Desktop
Tools > View Start Button Configuration Files. In previous versions,
this menu item was View Source Files. There has been no change in
functionality or features.
Changes to Look of Buttons in Desktop and Other Tools
Some icons on toolbar buttons have changed slightly. In addition,
standard desktop icon image files are no longer provided in the
matlabroot/toolbox/matlab/icons directory.
Compatibility Considerations. If your code relied on icon files in the
matlabroot/toolbox/matlab/icons directory (for example, for adding your
entries to the Start button or the Help browser), you might need to use other
image files.
Antialiasing Option No Longer Necessary on Windows and
Macintosh Platforms
MATLAB now follows the operating system’s font settings on Microsoft
and Macintosh platforms. This provides smooth fonts without the need for
antialiasing within MATLAB.
Running Functions — Command Window and History
New features and changes introduced in Version 7.5 (R2007b) are:
• “Command History — Find Entry by Letter Now Looks in Collapsed
Sessions” on page 253
• “Pop-Up Help for a Function in the Command Window” on page 254
Command History — Find Entry by Letter Now Looks in
Collapsed Sessions
When you type letters in the Command History, it finds and selects the
next entry that begins with the letters you typed. Now, if the entry is in a
session that was collapsed, MATLAB automatically expands the session and
selects the matching entry in it. In previous versions, MATLAB did not find
matching entries in collapsed sessions.
253
Version 7.5 (R2007b) MATLAB® Software
If you do not want to find entries in collapsed sessions (the previous behavior),
you can instead select Edit > Find, which finds text in the Command History,
but not in collapsed sessions. For more information, see “Finding Next Entry
By Letter”.
Pop-Up Help for a Function in the Command Window
For more information, see “Help on Selection Enhanced in Command Window
and Editor” on page 257.
Help
New features and changes introduced in Version 7.5 (R2007b) are:
• “Minor Visual Changes to Help Browser” on page 254
• “Demos and Help Browser Contents Now Include New Category for Links
and Targets” on page 254
• “Help on Selection Enhanced in Command Window and Editor” on page 257
Minor Visual Changes to Help Browser
• To open the Help browser from a tool’s Help menu, select Product Help.
In previous versions you selected Full Product Family Help.
• When the Help browser first opens, it displays help for MATLAB. In
previous versions, it displayed a Begin Here page. The information
previously available on the Begin Here page has been incorporated into
the MATLAB roadmap page.
• When you close and reopen the Help browser, it maintains the list of pages
you previously viewed, but does not open to the page you last viewed. In
previous versions, upon reopening, the Help browser displayed the page
you last viewed.
Demos and Help Browser Contents Now Include New Category
for Links and Targets
When you run the demo function or access Demos or Contents in the Help
browser, there is a new category for Link and Target products.
254
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
To use the demo function to access a demo that is now in the Links and
Targets category, you specify the new subtopic ’links and targets’, followed by
the category. For example
demo('links and targets', 'link for modelsim')
displays the Demos pane, and expands the Link for ModelSim® demos listing.
In the Help Demos, Link and Target products appear together in their own
category, and are identifiable by the new Links and Targets icon,
.
In the Help Contents, Link and Target products appear together after any
installed Simulink and blockset products, and are identifiable by the new
Links and Targets green book icon,
.
255
Version 7.5 (R2007b) MATLAB® Software
This new category is also used in the Start button in the MATLAB
desktop—for more information, see “Start Button Now Includes New Category
for Links and Targets” on page 252.
If you add help or demos to the Help browser for your own toolbox or list
your own toolbox in the Start button and you want to take advantage of
256
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
the new Links and Targets category, use the new type, links_targets, in
the info.xml file for your toolbox.
Compatibility Considerations. In previous versions, when you used the
demo function to access a demo that is now in the Links and Targets category,
you specified a different subtopic and category. If you have any code that
relies on the demo function for accessing Links and Targets demos, you will
need to replace the subtopic and category in the code.
In previous versions, you accessed the products in the Help browser Demos
from the Toolbox or Simulink software categories.
In previous versions, you accessed the products in the Help browser Contents
from within the list of toolbox products (orange book icon) or Simulink
products (blue book icon).
Help on Selection Enhanced in Command Window and Editor
To get help for a function in the Command Window or the Editor, click the
pointer in the function name and press F1. The reference page for that
function appears in a small help window. To close the window, press Escape.
You can also access the feature by choosing Help on Selection from the
context menu. For details, see “Getting Help for a Function Shown in the
Command Window or Editor”.
257
Version 7.5 (R2007b) MATLAB® Software
258
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
Compatibility Considerations. In the previous version, you could select the
function name, right-click, and select Help on Selection. The documentation
appeared in the Help browser. Now if you want to see the documentation
for the function in the Help browser, first access the pop-up help, and then
click the Open Help Browser link.
Editing and Debugging M-Files
New features and changes introduced in Version 7.5 (R2007b) are:
• “Run Your Function M-Files in the Editor/Debugger Using Configurations”
on page 259
• “Run/Continue Button Changes” on page 260
• “Code Folding Feature for Collapsing and Expanding Code” on page 261
• “Quick Help for a Function in the Editor” on page 263
• “Line Endings Removed in Files Provided with MATLAB Software for
Windows Platforms; Impacts Viewing in Notepad Application” on page 263
• “Stand-Alone Editor Will Not Be Included in Next Version” on page 266
• “Determine the McCabe (Cyclomatic) Complexity of an M-File” on page 267
Run Your Function M-Files in the Editor/Debugger Using
Configurations
In the Editor/Debugger, you can provide values for a function’s input
arguments using a configuration, and then run that configuration to use the
assigned values. Use a configuration as an alternative to running the function
in the Command Window. You can associate multiple configurations with an
M-file, each for different input values. MATLAB saves the configurations
between sessions.
To create a configuration, first open an M-file in the Editor/Debugger. Then,
from the down arrow on the Run button in the toolbar
select Edit
Configurations for filename. In the resulting Edit M-File Configurations
dialog box, add statements and name the configuration. For more information,
see “Using Run Configurations to Run Files with Input Arguments in the
Editor”.
259
Version 7.5 (R2007b) MATLAB® Software
Run/Continue Button Changes
The Run/Continue button has a new look and new location on the
Editor/Debugger toolbar.
260
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
New look and position of Run/Continue button
Run/Continue button in previous versions
Compatibility Considerations. The button performs the same as it did in
previous versions, but you need to access it in the new position.
Code Folding Feature for Collapsing and Expanding Code
To improve the readability of files containing several subfunctions, the Editor
includes a code folding feature, which is enabled by default. Using this
feature you can collapse and expand subfunctions and their associated help.
The following figure shows the collatzplot_new function collapsed, such
that only the function definition is displayed. The figure shows the collatz
function expanded, revealing both the help code and the function code. If you
collapse just the help code, only the H1 help line displays.
261
Version 7.5 (R2007b) MATLAB® Software
Click to expand
function
Click to collapse
function
Click to
collapse help only
262
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
• To expand code that is collapsed, click the plus sign (+) to the left of the
code you want to expand.
• To collapse code that is expanded, click the minus sign (-) to the left of the
code you want to collapse.
• To expand or collapse all of the code in an M-file, place your cursor
anywhere within the M-file, right-click, and then select Code Folding >
Expand All or Code Folding > Collapse All from the context menu.
For more information, see Code Folding—Expanding and Collapsing M-File
Constructs
Quick Help for a Function in the Editor
For more information, see “Help on Selection Enhanced in Command Window
and Editor” on page 257.
Line Endings Removed in Files Provided with MATLAB
Software for Windows Platforms; Impacts Viewing in Notepad
Application
In previous versions, text files provided with MATLAB for Windows platforms
included a carriage return and line feed at the end of each line. Starting in
R2007b, the text files MATLAB provides do not include a carriage return
and line feed at the end of each line.
File types affected are:
• .asc
• .bat
• .c
• .cc
• .cdr
• .cpp
• .def
• .for
263
Version 7.5 (R2007b) MATLAB® Software
• gs.rights
• .h
• .ini
• .m
• .mdl
• .pl
• readme
• .tlc
• .tmf
• .txt
There is no impact if you view the files in MATLAB and other common text
editors, with the known exception of the Microsoft Notepad application.
Compatibility Considerations. If you use the Notepad application to view
files provided with MATLAB, you see carriage return and line feed symbols
instead of line endings. This makes the files less readable in the Notepad
application. Other text editors might display the symbols instead of line
endings, but of the common text editors tested, none have been found that
do so.
As an alternative to the Notepad application, use the Microsoft WordPad
application, provided with Windows platforms, or another text editor to view
the files.
If your Windows file associations are set to associate any of the listed file types
with Notepad, change the associations to use WordPad or another text editor.
The following illustration shows how the ver M-file included with MATLAB
Version 7.5 looks when opened in the Notepad application.
264
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
M-file from MATLAB Version 7.5 when
opened in Notepad shows symbols instead of line endings.
The following illustration shows how the ver M-file included with MATLAB
Version 7.5 looks when opened in the WordPad application.
265
Version 7.5 (R2007b) MATLAB® Software
M-file from MATLAB Version 7.5 when
opened in WordPad shows line endings.
There are no problems with files you create or edit in the Notepad application,
and then view or edit in MATLAB. The files have line endings in the MATLAB
Editor, and continue to have line endings when you open them in the Notepad
application.
(Microsoft product screen shot(s) reprinted with permission from Microsoft
Corporation.)
Stand-Alone Editor Will Not Be Included in Next Version
The MATLAB stand-alone Editor (meditor.exe) will no longer be provided,
starting in the next version of MATLAB. Instead of the stand-alone Editor,
you can use the MATLAB Editor/Debugger. It provides all the features of the
stand-alone Editor, plus the following:
• Tab completion
266
Desktop Tools and Development Environment, MATLAB® Version 7.5 (R2007b)
• Debugging M-files
• Evaluating selections
• Accessing source control features
• Docking the tool in the MATLAB desktop
• Using cell features for rapid code iteration or publishing
Compatibility Considerations. Some users have preferred the stand-alone
Editor to the MATLAB Editor/Debugger because of slightly better startup
performance and because it does not require a MATLAB license. For those
situations, you can use any text editor you have, such as the UltraEdit®
application from IDM Computer Solutions, or the GNU Emacs software.
Determine the McCabe (Cyclomatic) Complexity of an M-File
The cyc option to the mlint function enables you to determine the McCabe
complexity (also referred to as the cyclomatic complexity) of an M-file. Higher
McCabe complexity values indicate higher complexity, and there is some
evidence to suggest that programs with higher complexity values are more
likely to contain errors. Frequently, you can lower the complexity of a function
by dividing it into smaller, simpler functions. In general, smaller complexity
values indicate programs that are easier to understand and modify. Some
people advocate splitting up programs that have a complexity rating over 10.
See mlint for syntax and an example.
Publishing Results
New features and changes introduced in Version 7.5 (R2007b) are:
• “Notebook and Word for Office 2007” on page 267
• “Text Markup in Cells for Publishing” on page 268
• “Preference to Restrict Lines of Output” on page 268
Notebook and Word for Office 2007
Notebook now supports Microsoft Word for Office 2007. For details, see
“Creating a MATLAB Notebook to Publish to Microsoft Word”.
267
Version 7.5 (R2007b) MATLAB® Software
Text Markup in Cells for Publishing
The following Editor/Debugger menu items are added to assist you in marking
up cells in the Editor/Debugger for publishing. Access the menu items
presented in the following list from Cell > Insert Text Markup . When
you select the menu item, the Editor inserts code to assist you in adding the
text markup for the specified item.
• Document Title and Introduction
• Section Title with Cell Break
• Hyperlinked Text
• Image
• Numbered List
• HTML Markup
• LaTeX Markup
The first two list items are provided instead of the Cell Title and Descriptive
Text menu items that were offered in Version 7.4 (R2007a).
As an alternative to using the Cell menu items, you can manually insert code
to mark up cells in your M-file for publishing. For details on the Cell menu
items and the resulting code see Marking Up Text in Cells for Publishing
Preference to Restrict Lines of Output
You can now specify options to restrict the number of lines included in the
output of a published M-file. To access this option from the Editor/Debugger,
follow these steps:
1 Select File > Preferences > Editor/Debugger > Publishing
2 In the Editor/Debugger Publishing Preferences pane, select the Evaluate
code and Restrict output to options.
3 Specify the maximum number of lines that you want to include in the
output.
268
Mathematics, MATLAB® Version 7.5 (R2007b)
Mathematics, MATLAB Version 7.5 (R2007b)
New features and changes introduced in this version are:
• “New Functions” on page 269
• “finite Function Deprecated” on page 269
• “dmperm Function Gives Coarse Decomposition” on page 270
• “ldl Function Supports Real Sparse Symmetric Matrices” on page 270
• “Upgrade to LAPACK Library” on page 270
• “Upgrade to BLAS Libraries” on page 270
• “Library for LAPACK and BLAS Symbols Separated” on page 270
• “Colon Operations on Characters Return Character Type Data” on page 271
• “Matrix Generating Functions No Longer Accept Complex Inputs” on page
271
New Functions
Function
Description
quadgk
Numerically evaluates the integral, adaptive
Gauss-Kronrod quadrature
bvp5c
Solves boundary value problems for ordinary
differential equations, notably useful for small
error tolerances
maxNumCompThreads
Gets and sets the maximum number of
computational threads
finite Function Deprecated
In this release, the finite function displays a warning message that the
function is now deprecated. Support for finite will be removed in a future
release of MATLAB software.
269
Version 7.5 (R2007b) MATLAB® Software
Compatibility Considerations
It is recommended that you replace all calls to finite with the isfinite
function.
dmperm Function Gives Coarse Decomposition
The dmperm function now provides two additional output arguments for the
indices of the Dulmage-Mendelsohn coarse decomposition.
ldl Function Supports Real Sparse Symmetric Matrices
The ldl function now provides factorization and solving for an additional
output argument, the scaling matrix, when the input matrix is real sparse
and symmetric.
Upgrade to LAPACK Library
MATLAB software now uses Version 3.1 of the Linear Algebra Package
(LAPACK) library.
Upgrade to BLAS Libraries
For AMD® processors, MATLAB software now uses Version 3.6 of the AMD
Core Math Library (ACML™) for the Basic Linear Algebra Subroutine
(BLAS) libraries.
Library for LAPACK and BLAS Symbols Separated
The binder library, libmwlapack.lib, containing both LAPACK and BLAS
symbols is now two separate library files: libmwlapack.lib for LAPACK
symbols and libmwblas.lib for BLAS symbols.
Compatibility Considerations
If you previously linked to the libmwlapack.lib library to use the BLAS
symbols, you will need to update your code to link to the libmwblas.lib
library.
270
Mathematics, MATLAB® Version 7.5 (R2007b)
Colon Operations on Characters Return Character
Type Data
Using a colon with characters to iterate a for-loop now returns data of type
character. For example,
for x='a':'b',x,end
results in
x =
a
x =
b
Compatibility Considerations
Previously, colon operations with characters iterating a for-loop returned data
of type double. In previous releases the above example returned:
for x='a':'b',x,end
x =
97
x =
98
Existing program code that relies on the colon operations of character arrays
returning a double, needs to be updated to expect a character data type.
Matrix Generating Functions No Longer Accept
Complex Inputs
Calling matrix generating functions, such as ones, zeros, rand, randn, true,
and false, with a complex number as dimensions input now returns the error:
true([1 i])
??? Error using ==> true
Size vector must be a row vector with real elements.
271
Version 7.5 (R2007b) MATLAB® Software
Compatibility Considerations
In previous releases, if you supplied a complex number as a dimension input,
MATLAB software returned:
true([1 i])
Warning: Size vector should be a row vector with integer elements.
Complex inputs will cause an error in a future release.
ans =
Empty matrix: 1-by-0
Existing program code that relies on entering complex numbers as dimension
input to a matrix generating function should be modified.
272
Data Analysis, MATLAB® Version 7.5 (R2007b)
Data Analysis, MATLAB Version 7.5 (R2007b)
There were no new features or changes in this version.
273
Version 7.5 (R2007b) MATLAB® Software
Programming, MATLAB Version 7.5 (R2007b)
New features and changes introduced in this version are
• “Increased Size for Large Arrays” on page 274
• “Documentation for Multiprocessing in MATLAB” on page 274
• “Setting Number of Threads Programmatically” on page 275
• “New Internal Format for P-code” on page 275
• “New Split String Functionality in regexp” on page 275
• “Changes Related to Error Handling” on page 276
• “Results From tempname Are More Unique” on page 279
• “MATLAB Includes New Input Argument Validation Functions” on page
279
• “Windows Current Working Directory Corrected” on page 279
• “New Multimedia Functionality” on page 280
• “Compressed AVI Video Files in Windows Vista and Windows XP x64”
on page 281
• “mmfileinfo Reads Files on MATLAB Path” on page 281
• “Changes to imread Support of TIFF Format” on page 281
• “Removal of freeserial Function” on page 282
Increased Size for Large Arrays
On 64-bit platforms, MATLAB arrays are no longer limited to 231 elements.
The limit in MATLAB 7.5 is 248-1. For example, given sufficient memory,
many numeric and low-level file I/O functions now support real double arrays
greater than 16 GB.
Documentation for Multiprocessing in MATLAB
Documentation for “Multiprocessing in MATLAB” has moved from Desktop
Tools and Development Environment to the “Improving Performance and
Memory Usage” section of MATLAB Programming.
274
Programming, MATLAB Version 7.5 (R2007b)
Setting Number of Threads Programmatically
In this release, MATLAB provides a way to set or retrieve the maximum
number of computational threads from within an M-file program. With the
maxNumCompThreads function, you can either set the maximum number of
computational threads to a specific number, or indicate that you want the
setting to be done automatically by MATLAB
New Internal Format for P-code
P-code files have a new internal format in MATLAB Version 7.5. The new
P-code files are smaller and more secure than those built with MATLAB 7.4
and earlier, and provide a more robust solution to protect your intellectual
property.
Any P-code files that were built using MATLAB 7.4 or earlier also work in
7.5. However, support for these older files will at some point be removed
from MATLAB.
P-code files built with MATLAB 7.5 only work on 7.5 or later. They cannot be
used with MATLAB 7.4 or earlier versions.
Compatibility Considerations
Rebuild any P-code files using MATLAB 7.5 that you expect to need in the
future.
New Split String Functionality in regexp
Using the regular expressions function regexp, you can now split an input
string into sections by specifying the new 'split' option when calling regexp:
s1 = ['Use REGEXP to split ^this string into ' ...
'several ^individual pieces'];
s2 = regexp(s1, '\^', 'split');
s2(:)
ans =
'Use REGEXP to split '
'this string into several '
275
Version 7.5 (R2007b) MATLAB® Software
'individual pieces'
The split option returns those parts of the input string that are delimited by
those substrings returned when using the regexp 'match' option.
Changes Related to Error Handling
New Error Handling Mechanism
MATLAB extends its error-handling capabilities with the new MException
class to provide you with a more secure and extensible system for throwing
and responding to errors. Read about this new feature in the “Error Handling”
section of the MATLAB Programming documentation and in related function
reference pages such as MException.
This feature extends the error-handling capabilities available in earlier
releases, but does not replace that functionality. Your M-file programs will
continue to function the same when using Version 7.5.
New Syntax for catch Function
As part of new error-handling mechanism, the catch function has a new,
optional syntax as shown here in a try-catch statement:
try
% Try to execute this block of code. Go to 'catch' on error
- code that may error catch ME
% Deal with the error captured in MException object, ME
- code to handle the error end
ME is an object of the MException class. This command gives you access to the
MException object that represents the error (i.e., exception) being caught.
Warning and Error Messages Now Wrap
In previous versions of MATLAB, warning and error messages that were
longer than the width of your terminal screen extended beyond the visible
276
Programming, MATLAB Version 7.5 (R2007b)
portion of your screen. These messages now wrap onto succeeding lines so
that the entire text of the warning or error is visible.
Change to Error Message from Anonymous Function
The error message and M-file line number that MATLAB displays when
encountering an error in an anonymous function defined within a script
file or at the MATLAB Command Line has changed in this release. In
MATLAB Version 7.4, the error message included the line number (set to 1 for
anonymous functions), and the stack information returned by the lasterror
function also showed the line number as 1. In MATLAB 7.5, the line number
is not displayed in the error message and is set to 0 in the returned stack
information.
For example, when you enter the following two lines at the command line,
MATLAB generates an error from the anonymous function:
X = @() error('* Error *');
X()
This example shows the difference between MATLAB Versions 7.4 and 7.5:
e = lasterror;
e.message
ans =
Error using ==> @()error('Error') at 1
Error using ==> @()error('Error')
* Error *
e.stack
ans =
file:
name:
line:
line:
''
'@()error('* Error *')'
1
0
% V7.4 response
% V7.5 response
% V7.4 response
% V7.5 response
277
Version 7.5 (R2007b) MATLAB® Software
Compatibility Considerations. If you have programs that rely on the line
number returned in response to an error in an anonymous function, these
programs may not work as expected. Remove dependencies on the returned
error message and line number, or update your program code to use the new
string and value.
New Message In Response to Ctrl+C
MATLAB now displays a more user-friendly message when you press Ctrl+C.
The previous response to Ctrl+C was
Error in ==> testctrlc>waitawhile at 5
pause(100);
Error in ==> testctrlc at 2
waitawhile
In this and future releases, pressing Ctrl+C still halts program execution,
but now displays the response
??? Operation terminated by user during ==> testctrlc>
waitawhile at 5
In ==> testctrlc at 2
waitawhile
Compatibility Considerations. You only need to be aware that the change
in the text of this message is intentional and does not signify any error on
your part.
hdfread Errors Instead of Warns on I/O Failures
In previous releases, hdfread issued a warning when a requested I/O
operation failed. In addition, hdfread created an empty variable in the
workspace. In this release, hdfread now errors when a requested I/O
operation fails and does not create an empty variable in the workspace.
Compatibility Considerations. If you call hdfread in a script to perform
an I/O operation and that operation fails, your script will now terminate.
Previously, because hdfread only warned when an I/O operation failed, your
script would continue processing.
278
Programming, MATLAB Version 7.5 (R2007b)
Results From tempname Are More Unique
The tempname function now produces a string such as
C:\Temp\tpe51f2ba3_9ad3_490f_8142_58359c98f4a5
when Java is present, or a string like
C:\Temp\tp346976948758473
when nojvm is selected. Underscores are included in the name so you can use
the filename portion of it as a valid M-function name. If a string row vector is
passed in as an argument, that string is used instead of tempdir as the root.
Compatibility Considerations
Because the new string generated by tempname is generally longer than the
string constructed in earlier versions, there is a possibility of exceeding length
restrictions, especially if your program code passes a string to the tempname
function. If you consider this to be a potential problem, verify that the strings
you pass to tempname will not result in an overly long string being returned.
MATLAB Includes New Input Argument Validation
Functions
MATLAB now includes two new functions that validate the input arguments
passed to functions. For example, you can use these functions to make sure
that an input argument is numeric and nonempty. The following table lists
these functions with a brief description.
Function
Description
validateattributes Check validity of array
validatestring
Check validity of text string
Windows Current Working Directory Corrected
On Windows, you can define a current working directory, cwd, for each drive
letter. For example, entering the command cd D:\work at the DOS prompt
defines your D current working directory as D:\work. All references to D:
are then relative to this directory.
279
Version 7.5 (R2007b) MATLAB® Software
The term . . .
Represents the directory . . .
D:
D:\work
D:matlab
D:\work\matlab
D:\matlab
D:\matlab
(Note the difference between D:\ and D:, where the former is the drive D, and
the latter is a user-defined working directory that may or may not be equal
to D:\.)
Previous versions of MATLAB have been inconsistent in the way that
volume-relative path specification is handled. For example, in MATLAB
7.4 and earlier, if D: were defined as the directory D:\work, the following
commands on the left and right returned identical results:
dir D:
dir D:matlab
fileparts('D:myfile.m')
dir D:\
dir D:\work\matlab
fileparts('D:\myfile.m')
This has been fixed in MATLAB 7.5 so that the following are now equivalent:
dir D:
dir D:matlab
fileparts('D:myfile.m')
dir D:\work
dir D:\work\matlab
fileparts('D:\work\myfile.m')
Compatibility Considerations
Some MATLAB commands may fail or return unexpected results if you use
Windows current working directories on MATLAB. You might have to update
hard-coded paths if you have been relying on the incorrect behavior exhibited
in earlier versions.
New Multimedia Functionality
A new mmreader video file reader object for Windows platforms supports
formats such as AVI, MPEG, and WMV, and adds the ability to read
additional video codecs that aviread does not support. For more information,
see the mmreader and read reference pages.
280
Programming, MATLAB Version 7.5 (R2007b)
Compressed AVI Video Files in Windows Vista and
Windows XP x64
Because Windows Vista, Windows Vista 64-bit, and Windows XP x64
operating systems do not ship with the Indeo® 5 codec, which is the default
codec used by MATLAB Audio-Video functions for file compression, the
functions movie2avi and avifile now generate uncompressed AVI files on
these platforms. Also, aviread on these platforms cannot read files that were
compressed using the Indeo 5 codec.
Compatibility Considerations
If you have upgraded your Windows operating system to Windows
Vista, Windows Vista 64-bit, or Windows XP x64, you need to install
the Indeo 5 codec to read or create Indeo 5 compressed AVI files
with aviread, avifile, or movie2avi. You can learn more about
downloading the Indeo 5 codec from the Ligos Corporation Web site at
http://ligos.com/index.php/home/products/indeo/
mmfileinfo Reads Files on MATLAB Path
The mmfileinfo function now reads files on the MATLAB path, not only those
in the current directory. The mmfileinfo output struct contains a field called
Path, which indicates the directory where the file exists.
Compatibility Considerations
The Filename field of the output struct from mmfileinfo now contains only
the filename itself without any path information, while the path information
is contained in the Path field. In previous releases, the Filename field
contained both path and filename information.
Changes to imread Support of TIFF Format
The imread function includes several updates to its TIFF support:
• imread reads TIFF files that use JPEG, LZW, and Deflate compression.
• imread reads image data from TIFF files in any arbitrary samples-per-pixel
and bits-per-sample combination.
281
Version 7.5 (R2007b) MATLAB® Software
• imread provides increased performance when reading large images, when
used with the ’PixelRegion’ parameter.
Removal of freeserial Function
The freeserial function is now obsolete. Use fclose to release the serial
port.
Compatibility Considerations
If your program code still makes use of the freeserial function, replace each
instance with the fclose function instead.
282
Graphics and 3-D Visualization, MATLAB® Version 7.5 (R2007b)
Graphics and 3-D Visualization, MATLAB Version 7.5
(R2007b)
New features and changes introduced in this version are:
• “Datatips Are Now Saved to FIG-Files” on page 283
• “New Options for Displaying Groups of Lines in Legends” on page 283
• “Drawnow Update Option Now Updates Uicontrols Only” on page 284
• “Annotation Textboxes Can Automatically Resize to Fit their Contents”
on page 284
• “Property Inspector Now Has Context-Sensitive Help” on page 286
• “The “v6” Option for Creating Plot Objects is Obsolete” on page 286
Datatips Are Now Saved to FIG-Files
When you save a figure, all datatips existing in it are saved along with other
annotations. When you open the FIG-file, the datatips are displayed and can
be manipulated or deleted in the same ways they could in the original figure.
Compatibility Considerations
If you open a FIG-file containing datatips while using a previous MATLAB
version (V7.4 or earlier), no error results, but the datatips do not display.
New Options for Displaying Groups of Lines in
Legends
You can now customize how legends for figures display groups of lines, such as
contours. Previously, legends displayed groups of lines such as contourgroups
with a glyph that represented the entire group; now users have the flexibility
to designate a single legend entry, a legend entry for each child of the group,
or no legend entries for the group.
By default, a legend entry for an hggroup now consists of the DisplayName of
its first child and a glyph representing it (previously, no glyph appeared, only
the DisplayName). This is what you now see after clicking the legend tool icon
in the figure’s toolbar. However, you can set the new Annotation property
283
Version 7.5 (R2007b) MATLAB® Software
of hggroups to control how the group is represented in a legend. For details
and examples of its use in customizing legends, see “Controlling Legends” in
the Graphics documentation.
Drawnow Update Option Now Updates Uicontrols
Only
The drawnow command can now selectively update the display of UI
components. The update option enables you to update only uicontrol objects
without allowing callbacks to execute or processing other events in the queue.
Annotation Textboxes Can Automatically Resize to
Fit their Contents
In previous releases, textboxes had fixed sizes that users needed to adjust to
fit the size of their contents. Now, if you create a textbox annotation using a
GUI or the annotation function, it can grow or shrink to just fit the text you
type into it. This behavior is controlled by the Annotation Textbox object’s
FitBoxToText property, which can be 'on' or 'off'. When you create a
textbox with the Annotation toolbar (using the
tool), this property is set to
'on' if you create a textbox without dragging; however, if you drag to make
the new textbox have a certain size, the property is initially 'off'. When you
create a textbox with the annotation function, for example,
htb = annotation('textbox')
without specifying a position and size, the textbox is created with
FitBoxToText set to 'on'. If you specify a position vector in the command,
for example,
htb = annotation('textbox', [.1 .8 .4 .1])
the textbox is created with FitBoxToText set to 'off'.
Similarly, if you resize a textbox in plot edit mode or change the width or
height of its position property directly, its FitBoxToText property is set to
'off'. You can toggle this property with set, with the Property Inspector,
or more conveniently, via the object’s context menu, as the illustration below
shows.
284
Graphics and 3-D Visualization, MATLAB® Version 7.5 (R2007b)
If you edit a textbox that has FitBoxToText set to 'on', the textbox resizes to
accommodate the number of characters and lines in the text as you type. You
can reposition the textbox without changing the FitBoxToText property, but
as soon as you resize it, the property becomes (or remains) 'off'.
285
Version 7.5 (R2007b) MATLAB® Software
Property Inspector Now Has Context-Sensitive Help
When you use the Property Inspector (the inspect command), you can
now ask for a description of any property it shows. The descriptions come
from the property reference page for the type of object being inspected
(e.g., axes, lineseries, annotations, uicontrols, etc.). To get a description
of a property, right-click its name in the left-hand column of the Property
Inspector and select What’s This? from the context menu that appears. A
mini-help window opens to show the property’s description from the object’s
property reference page. If you need an overview of all properties pertaining
to particular kinds of objects and how these objects relate, scroll through
the entries in the mini-help window or open the Handle Graphics Property
Browser from the Help Browser.
The “v6” Option for Creating Plot Objects is Obsolete
Prior to MATLAB Version 7, handles returned by high-level plotting functions
referenced graphic primitives, such as lines and patches. In Version 7,
MATLAB began bundling the primitives into “series” objects, for example,
lineseries, barseries, and contourgroups. At that time, the v6 option was
added to plotting functions to enable users of MATLAB Version 7.x to create
FIG-files that previous versions can open. The v6 option is now obsolete. It
will be removed in a future MATLAB release. The following functions include
the option in their syntax and now warn when it is used:
• area
• bar
• barh
• colorbar
• contour
• contourf
• errorbar
• legend
• loglog
• mesh
• meshc
286
Graphics and 3-D Visualization, MATLAB® Version 7.5 (R2007b)
• meshz
• plot
• quiver
• scatter
• scatter3
• semilogx
• semilogy
• stairs
• stem
• stem3
• subplot
• surf
• surfc
Compatibility Considerations
Specifying the v6 flag to any plotting function now results in a warning that
the option is being removed, but the option still functions. To generate a
FIG-file for a plot created with the v6 option, you still need to use the -v6
option to the hgsave command in order to save it in a form that a previous
version of MATLAB can read. Figures containing annotations (such as
textboxes, arrows, ovals, and rectangles) that are saved this way open in
previous versions, but the annotations do not display because different objects
are used to contain them in Version 7 than before. That is, the annotation
objects have never been backward compatible.
287
Version 7.5 (R2007b) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.5 (R2007b)
New features and changes introduced in this version are:
• “New Editors for Creating Custom Toolbars within GUIDE” on page 288
• “Coordinate Readouts in Layout Editor” on page 289
• “Documentation for Making GUIDE GUIs Interact” on page 289
• “Functions Being Removed” on page 290
New Editors for Creating Custom Toolbars within
GUIDE
In previous releases, adding toolbars to a GUI had to be done
programmatically, by writing code for the uitoolbar, uipushtool and
uitoggletool functions. GUIDE now has a Toolbar Editor and an associated
Icon Editor that allow you to lay out a toolbar for a GUI and populate it with
standard predefined tools for printing, saving, panning, zooming, annotating,
etc. or with custom tools that you design yourself. You can draw or modify
an icon for any tool on your toolbar with the Icon Editor or import one from
an image file.
The Toolbar Editor
When you run GUIDE to create a new GUI or edit an existing one, click the
Toolbar Editor icon in the Layout Editor Toolbar or choose Toolbar Editor
from the Tools menu to open the Toolbar Editor. To add tools to the toolbar of
your GUI, you drag standard or custom tool icons to the toolbar layout area
at the top. You can modify a tool’s properties using the Toolbar Editor and
Property Inspector. You can also create and customize icons for tools using
the new Icon Editor, described next. You control the behavior of a tool in your
toolbar with its ClickedCallback (and for toggle tools, their OnCallback
and OffCallback) in the GUI’s associated M-file. If you use an existing tool,
such as Print or Save, you do not need to modify its callback; it is predefined
as %default.
288
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.5 (R2007b)
The Icon Editor
The Icon Editor lets you customize the icons for existing tools or create entirely
new icons. Icons are stored as CData for each tool, and can also be read from
and saved to .icn files. The Icon Editor also includes a Color Editor, a palette
you can use for picking predefined colors and defining new ones.
Coordinate Readouts in Layout Editor
The GUIDE Layout Editor now has two fields in its lower left corner that
continuously provide numeric feedback for:
• Current Point — The cursor location within the layout window
• Position — The Position property of the currently selected object(s) in
the layout window
Both measurements are given in pixels, regardless of the current Units
settings for GUI objects. When multiple objects are selected, any elements of
their Position properties that are not identical are read out as MULTI. The
readouts help you to precisely size and align GUI components.
Documentation for Making GUIDE GUIs Interact
A new documentation section, “Making Multiple GUIs Work Together”,
has been added to illustrate how multiple GUIDE GUIs can work together
by sharing data to create a more complicated GUI. It first summarizes the
techniques that GUIDE GUIs can use to share data with one another. It then
steps through two examples, accompanied by their M-files and FIG-files, to
show how to use those techniques for specific tasks.
289
Version 7.5 (R2007b) MATLAB® Software
Functions Being Removed
Function
Name
What
Happens
When You
Run the
Function?
Use This Function
Instead
Compatibility
Considerations
axlimdlg
Errors
None
No replacement
cbedit
Errors
guide
Use the guide
command instead
clruprop
Errors
rmappdata
Replace existing
instances of
clruprop with
rmappdata
ctlpanel
Errors
guide
Use the guide
command instead
edtext
Errors
Set the editing
property on the text
object
No replacement
extent
Errors
Get the extent
property of the text
object
No replacement
getuprop
Errors
getappdata
Replace existing
instances of
getuprop with
getappdata
290
hthelp
Errors
web
Replace existing
instances of hthelp
with web
layout
Errors
None
No replacement
matq2ws
Errors
None
No replacement
matqdlg
Errors
None
No replacement
matqparse
Errors
None
No replacement
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.5 (R2007b)
Function
Name
What
Happens
When You
Run the
Function?
Use This Function
Instead
Compatibility
Considerations
matqueue
Errors
None
No replacement
menubar
Errors
Set the menubar
property of the figure
to none
No differences
menuedit
Errors
guide
Use the guide
command instead
pagedlg
Errors
pagesetupdlg
Replace existing
instances of pagedlg
with pagesetupdlg
setuprop
Errors
setappdata
Replace existing
instances of
setuprop with
setappdata
umtoggle
Errors
Set the Checked
property of uimenu
objects
No differences
wizard
Errors
guide
Use the guide
command instead
ws2matq
Errors
None
No replacement
291
Version 7.5 (R2007b) MATLAB® Software
External Interfaces/API, MATLAB Version 7.5 (R2007b)
• “Support for 64-bit mxArrays” on page 292
• “Fortran MEX-Files Will Require mwSize and mwIndex” on page 293
• “Changes to the MATLAB Locale Setting” on page 293
• “Changes to MEX Error-Handling Functions mexErrMsgTxt and
mexErrMsgIdAndTxt” on page 294
• “Rebuild MEX-Files Created with MATLAB Versions Earlier Than V7
(R14)” on page 294
• “Changes to Compiler Support” on page 294
• “Changes to Applications Built with Borland 5.5 or 5.6 C Compilers” on
page 296
• “Environment Variable Required for mex with Microsoft Platform SDK
Compiler” on page 296
• “Environment Variables Required for mex with Intel Visual Fortran 9.0”
on page 296
• “Changes to Handling ActiveX Methods” on page 297
• “Changes to Dynamic Data Exchange (DDE) Documentation” on page 297
Support for 64-bit mxArrays
MATLAB Version 7.5 (R2007b) supports 64-bit mxArrays. This change allows
C/C++ and Fortran files built on 64-bit platforms to handle large data arrays.
In earlier versions of MATLAB, mxArrays are limited to 231-1 elements. In
Version 7.5 (R2007b) your mxArray can have up to 248-1 elements.
The mex command option, -largeArrayDims, uses the large-array-handling
mxArray API. Use mwSize to represents size values, such as array dimensions
and number of elements. Use mwIndex to represent index values, such as
indices into arrays.
292
External Interfaces/API, MATLAB® Version 7.5 (R2007b)
Compatibility Considerations
MEX-files that built properly in previous versions of MATLAB continue to
build in Version 7.5 (R2007b).
The default option for mex is -compatibleArrayDims. If you use this option,
mex builds the files using the 32-bit array-handling API.
To work with 64-bit mxArrays, your C, C++ and Fortran source code must
comply with the 64-bit array-handling API. To use the API to create C/C++
MEX-files, see “Handling Large mxArrays” . To use the API to create Fortran
MEX-files, see “Handling Large mxArrays” .
Fortran MEX-Files Will Require mwSize and mwIndex
In a future version of MATLAB, the default mex command option will change
to -largeArrayDims. Fortran MEX-files will be required to use the mwSize
and mwIndex preprocessor macros
Compatibility Considerations
To make your Fortran MEX-file compatible with the -largeArrayDims option,
and to create platform-independent code, you need to include the fintrf.h
header file in your Fortran source files, and you need to name your source files
with an uppercase .F file extension. For information on creating MEX-files,
see the “Gateway Routine” in the Fortran MEX-Files topic.
Changes to the MATLAB Locale Setting
Retrieving and using the proper locale setting is a mandatory operation in
creating and using applications for international audiences. In R2007b,
MATLAB Version 7.5 standardizes the way it initializes the locale setting
across platforms. As a result, on Microsoft Windows platforms, MEX-files
that use C/C++ locale-dependent standard library functions should note that
MATLAB now sets the locale using the setlocale function.
Because of changes to Microsoft Visual Studio, MEX-Files created on Windows
with dMicrosoft Visual Studio 2003 will not have the same locale setting
as MATLAB Version 7.5 (R2007b).
293
Version 7.5 (R2007b) MATLAB® Software
Note C/C++ users must not change the locale setting using the setlocale
function. This is true for all versions of MATLAB on all platforms.
Changes to MEX Error-Handling Functions
mexErrMsgTxt and mexErrMsgIdAndTxt
In MATLAB Version 7.5 (R2007b). the mexErrMsgTxt and mexErrMsgIdAndTxt
functions determine where the error occurred, and display the function name.
In previous versions, these functions only display the error message.
For example, if an error occurs in the function foo, mexErrMsgTxt and
mexErrMsgIdAndTxt display the following information before the error
message:
??? Error using ==> foo
Rebuild MEX-Files Created with MATLAB Versions
Earlier Than V7 (R14)
To work with MATLAB V7.5 (R2007b), MEX-files compiled on any platform
with MATLAB versions earlier than V7 (R14) no longer load correctly and
must be rebuilt.
Changes to Compiler Support
The set of compilers that MATLAB supports has changed in MATLAB Version
7.5 (R2007b). For an up-to-date list of supported compilers, see the Supported
and Compatible Compilers Web page.
• “New Compiler Support” on page 294
• “Discontinued Compiler Support” on page 295
• “Compiler Support to Be Phased Out” on page 295
New Compiler Support
MATLAB V7.5 (R2007b) supports new compilers for building MEX-files.
294
External Interfaces/API, MATLAB® Version 7.5 (R2007b)
Windows platforms.
• Microsoft Visual Studio 2005 SP1
Sun Solaris SPARC (64-bit) platform.
• gcc / g++ Version 4.1.2
Discontinued Compiler Support
The following compilers are no longer supported.
Windows platforms.
• Microsoft Visual Studio 2005 without SP1
SolarisSPARC (64-bit) platform.
• gcc / g++ Version 3.2.3
Compatibility Considerations. To ensure continued support for building
your C/C++ programs, consider upgrading to another supported compiler. For
an up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
Compiler Support to Be Phased Out
The following compilers are supported in Version 7.5 (R2007b), but will not be
supported in a future version of MATLAB.
Windows (32-bit) platform.
• Intel Visual Fortran Version 9.0
• Compaq Visual Fortran Version 6.6
• Intel C++ Version 7.1
• Borland C++Builder 6 Version 5.6
• Borland C++Builder 5 Version 5.5
• Borland C++ Compiler Version 5.5
295
Version 7.5 (R2007b) MATLAB® Software
• Compaq Visual Fortran Version 6.1
Changes to Applications Built with Borland 5.5 or
5.6 C Compilers
MATLAB applications built with Borland Version 5.5 or 5.6 C compilers have
changed in MATLAB Version 7.5 (R2007b). MATLAB applications that run
under Windows are now implemented as console applications, not Windows
applications.
Compatibility Considerations
If you have customized the build process based on one of the
bcc*engmatopts.bat options files, you must edit this file making changes to
the appropriate LINKFLAGS statement, as described in the .bat file comments.
Environment Variable Required for mex with
Microsoft Platform SDK Compiler
When you build a MEX-file, an engine application, or a MAT application
on a Windows 64-bit platform using the Microsoft Platform SDK compiler,
MATLAB requires that you define the environment variable MSSdk. The
value of this environment variable is the path to the installation directory for
Microsoft Platform SDK. The Microsoft Platform SDK installation program
does not commonly define this environment variable. For example, you might
set the environment variable as follows:
C:\Program Files\Microsoft Platform SDK
Environment Variables Required for mex with Intel
Visual Fortran 9.0
When you build a MEX-file, an engine application, or a MAT application using
Intel Visual Fortran 9.0, MATLAB requires that you define an environment
variable for the Windows platform you are using.
Windows (32-bit) platform
Define the environment variable VS71COMNTOOLS. The value of this
environment variable is the path to the Common7\Tools directory of the
Visual Studio .NET 2002 or 2003 installation directory. (Intel Visual Fortran
296
External Interfaces/API, MATLAB® Version 7.5 (R2007b)
requires Visual Studio .NET 2002 or 2003 on 32-bit Windows platforms.)
The Visual Studio .NET 2003 installation program commonly defines this
environment variable. For example, you might set the environment variable
as follows:
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools
Windows x64 platform
Define the environment variable MSSdk. The value of this environment
variable is the path to the installation directory for Microsoft Platform SDK for
Windows Server 2003. (Intel Visual Fortran requires Microsoft Platform SDK
for Windows Server 2003 on Windows x64 platforms.) The Microsoft Platform
SDK installation program does not commonly define this environment
variable. For example, the environment variable might have the value
C:\Program Files\Microsoft Platform SDK
Changes to Handling ActiveX Methods
In MATLAB Version 7.4 (R2007a), a change was made to Microsoft® ActiveX®
methods which was not documented in the release notes. This change is
described in “Changes to Handling Microsoft® ActiveX Methods” on page 348
in the MATLAB Release Notes, Version 7.4 (R2007a).
Changes to Dynamic Data Exchange (DDE)
Documentation
In MATLAB V5.1, all development work for the Dynamic Data Exchange
(DDE) server and client was stopped. This functionality is no longer
documented in V7.5 (R2007b). MathWorks provides, instead, a MATLAB
interface to COM technology that is documented in “COM Support for
MATLAB Software”.
Obsolete Functionality No Longer Documented
Documentation for Dynamic Data Exchange (DDE) is no longer included in
External Interfaces.
297
Version 7.5 (R2007b) MATLAB® Software
Compatibility Considerations. If you must support this obsolete
functionality, we suggest you print a copy of the External Interfaces chapter
“COM and DDE Support (Windows Only)” from MATLAB V7.4 (R2007a) or
earlier.
Documentation for Obsolete Functions To Be Phased Out
Documentation for the following functions is included in the MATLAB
Function Reference documentation for MATLAB V7.5 (R2007b), but will not
be included in a future version of MATLAB.
Obsolete Functions
ddeadv
ddeexec
ddeinit
ddepoke
ddereq
ddeterm
ddeunadv
The following syntax for enableservice, included in the MATLAB Function
Reference documentation for MATLAB V7.5 (R2007b), will be removed from
the documentation.
enableservice('DDEServer',enable)
Compatibility Considerations. If you must support this obsolete
functionality, we suggest you print and keep a copy of the relevant MATLAB
function reference pages from V7.5 (R2007b) or earlier.
298
Version 7.4 (R2007a)
MATLAB Software
This table summarizes what’s new in Version 7.4 (R2007a):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.4
(R2007a)” on page 301
• “Mathematics, MATLAB Version 7.4 (R2007a)” on page 323
• “Data Analysis, MATLAB Version 7.4 (R2007a)” on page 326
• “Programming, MATLAB Version 7.4 (R2007a)” on page 327
• “Graphics and 3-D Visualization, MATLAB Version 7.4 (R2007a)” on page
335
299
Version 7.4 (R2007a) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.4
(R2007a)” on page 339
• “External Interfaces/API, MATLAB Version 7.4 (R2007a)” on page 342
300
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Desktop Tools and Development Environment, MATLAB
Version 7.4 (R2007a)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 301
• “Desktop” on page 306
• “Running Functions—Command Window and History” on page 314
• “Help” on page 315
• “Workspace, Search Path, and File Operations” on page 317
• “Editing and Debugging M-Files” on page 318
• “Tuning and Managing M-Files” on page 321
• “Publishing Results” on page 321
Startup and Shutdown
New features and changes introduced in Version 7.4 (R2007a) are
• “Double-Clicking Associated File Type in Explorer Now Opens File in
Existing Session of MATLAB Software” on page 301
• “Changes to Startup Directory (Folder) and Startup Options for MATLAB
Application on Windows” on page 302
• “JVM for Windows Updated” on page 305
• “New Version of Java Access Bridge Software” on page 306
• “Confirm Exit Preference to be Enabled by Default in Future Version”
on page 306
Double-Clicking Associated File Type in Explorer Now Opens
File in Existing Session of MATLAB Software
When you open a file from Microsoft Windows Explorer whose type is
associated with the MATLAB application, the file opens in the appropriate
tool in the existing session of MATLAB, if MATLAB is already running,
301
Version 7.4 (R2007a) MATLAB® Software
or if not, starts MATLAB. This assumes you associated the file types with
MATLAB by accepting the defaults while installing MATLAB, or by changing
the associations. For example, in Explorer, double-click an M-file to open
the file in the MATLAB Editor/Debugger, or double-click a MAT-file to open
the Import Wizard and load the data into the workspace in MATLAB. For
details, including how to change file associations, see “Associating Files with
MATLAB on Windows Platforms”.
Compatibility Considerations. In previous versions, when you
double-clicked a file in Explorer whose type was associated with MATLAB,
the file opened in a new session of MATLAB. The change made in MATLAB
Version 7.4 (R2007a) to open the file in an existing session was based on
many user requests.
In previous versions, double-clicking a MAT-file associated with MATLAB
in Explorer opened a new session ofMATLAB and loaded the data into the
workspace. When clicked in the Apple Macintosh Finder, the data loaded into
the existing session of MATLAB. Now on Microsoft Windows and Macintosh
platforms, the Import Wizard opens in the existing session of MATLAB, and
you use it to load the data into the workspace.
By default, in previous versions, double-clicking an M-file in Explorer opened
it in the MATLAB stand-alone Editor. For more information about that
change, see “Stand-Alone Editor No Longer Opens By Default; To Be Removed
in a Future Version” on page 318.
Changes to Startup Directory (Folder) and Startup Options for
MATLAB Application on Windows
The default startup directory for MATLAB on Microsoft Windows platforms is
now My Documents\MATLAB, or Documents\MATLAB on the Microsoft Windows
Vista platform. Upon startup, MATLAB automatically locates this MATLAB
folder (creating it if it does not exist), and adds it to the top of the search path.
This utilizes standard folders on Windows and Windows Vista platforms to
provide a unique startup directory for each user. As such, the folder is part of
theWindows (or Windows Vista) user’s profile, and will be accessible when the
user runs MATLAB from other machines, when the profile is set up to roam.
In the Properties dialog box of the shortcut icon for MATLAB, the Target
field includes a new startup option -sd (for startup directory), followed by
302
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
$documents\MATLAB, where MATLAB interprets $documents as the My
Documents folder for the current user (or Documents for the Windows Vista
platform). If the path for $documents is specified in the configuration of the
Windows environment via UNC pathname, MATLAB automatically assigns it
a mapped drive, creating one if necessary. The -sd startup option overrides
anything in the Start in field, which is now empty by default.
For more information, see “Changing the Startup Folder”.
303
Version 7.4 (R2007a) MATLAB® Software
Compatibility Considerations. In previous releases, the default startup
directory was \Work, located in the directory in which MATLAB was installed.
For example, in R2006b, if you installed MATLAB in C:\Program Files, the
default startup directory was C:\Program Files\MATLAB\R2006b\Work.
304
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Windows Vista User Account Control (UAC) security features restrict access
to Program Files. To accommodate this enhanced security model, the default
startup directory in MATLAB has been moved outside of Program Files.
These are the differences between the startup directory for R2007a and
previous releases:
• In previous releases, upon installation, the default startup directory was
specified in the Start in field of the Properties dialog box for the shortcut
icon for MATLAB. You could change the startup directory by replacing
the pathname in that field. In R2007a, if you want to specify the startup
directory using the Start in field, you must also remove from the Target
field the -sd startup option and the pathname that follows it.
• The default startup directory is no longer specific to a release. When you
upgrade from R2007a to a future release, files you created and saved in My
Documents\MATLAB (or Documents\MATLAB on Vista) will automatically be
in the startup directory for the new release. Previously, you had to move
files you created and saved in the Work folder for a release, for example,
R2006a\Work, to the default startup directory for the new release, for
example, R2006b\Work.
• In previous releases, the default startup directory, Work, was shared by all
users running that installation of MATLAB. The default startup directory
in R2007a, My Documents\MATLAB (or Documents\MATLAB on Vista),
provides each user with a unique startup directory.
• In previous releases, MATLAB added the default startup directory, Work, to
the bottom of the search path. In R2007a, MATLAB adds the default startup
directory, My Documents\MATLAB (or Documents\MATLAB on the Windows
Vista platform), to the top of the search path. In R2007a, for consistency
with previous releases, MATLAB adds ...\MATLAB\R2007a\Work to the
bottom of the search path. However, we encourage you to stop using the
Work folder because support for it might be removed in a future release.
JVM for Windows Updated
MATLAB is now using Sun Microsystems Java (JVM) version 1.5.0_07 on
Windows platforms. Java is supplied with MATLAB for Windows platforms,
so this change requires no action on your part.
305
Version 7.4 (R2007a) MATLAB® Software
Compatibility Considerations. If you use a specific version of Java with
MATLAB on Windows platforms, this change might impact you.
New Version of Java Access Bridge Software
MATLAB now installs Java Access Bridge 2.0, which is used by Freedom
Scientific BLV Group JAWS® software for accessibility support.
Confirm Exit Preference to be Enabled by Default in Future
Version
When you exit from MATLAB, MATLAB terminates without displaying a
confirmation dialog box that asks if you are sure you want to quit. This is the
default behavior but you can set a preference to display a confirmation dialog
box. In a future version, the confirmation dialog box will appear by default
when you quit MATLAB.
Compatibility Considerations. When the confirmation dialog appears
by default, you will be able to disable it using preferences. If you have files
that include exit statements, you might need to ensure the preference for the
confirmation dialog box is disabled.
Desktop
New features and changes introduced in Version 7.4 (R2007a) are
• “Minimize, Temporarily Display, and Restore Tools in the Desktop” on
page 306
• “Maximize Tools in the Desktop” on page 310
• “Tabs for Tools Replaced by Title Bars” on page 312
• “Multithreaded Computation Support Added; Enable Via New Preference”
on page 314
Minimize, Temporarily Display, and Restore Tools in the
Desktop
On Windows and The Open Group UNIX platforms, you can minimize any
tool in the desktop. Minimizing a tool creates a button for it along the
specified edge. When you want to view the tool, hover over or click the button
306
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
to temporarily show it in the desktop. Right-click the button and select
Restore toolname to return the tool to the desktop. Perform these tasks for
the selected tool using items in the Desktop menu, equivalent mnemonics
(for example Alt+D, N to minimize), or buttons on the tool’s titlebar.
The following illustrations show how to use these features, using the example
of the Command History window in the default desktop layout.
Minimize a
tool, for
example, the
Command
History
window.
307
Version 7.4 (R2007a) MATLAB® Software
When minimized, a tool, such as the Command Window in this example,
is represented by a button on the desktop border.
308
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Hover over or click the button for a minimized tool to temporarily view the tool.
The tool is temporarily displayed until you select another tool.
Then the tool becomes minimized again.
309
Version 7.4 (R2007a) MATLAB® Software
On the button for a minimized tool, right-click, and from the context menu, select Restore.
The tool resumes the size and position it had in the desktop before it was minimized.
For more information, see “Opening and Arranging Desktop Tools” and
“Minimized Tools in Desktop Example”.
Maximize Tools in the Desktop
On Windows and UNIX platforms, you can maximize a tool so it occupies
the entire desktop tool area in MATLAB, then restore it to return it to its
previous location. Perform these tasks for the selected tool using items in the
Desktop menu, equivalent mnemonics (for example Alt+D, X to maximize),
or buttons on the tool’s titlebar.
310
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Default desktop layout.
Maximize a tool, for example, the Command Window
so it occupies the full MATLAB desktop area.
311
Version 7.4 (R2007a) MATLAB® Software
Maximized, the Command Window now occupies the full desktop area.
Restoring the Command Window returns it to its original size and
location in the desktop.
For more information, see “Opening and Arranging Desktop Tools” and
“Maximized Tool in Desktop Example”.
Tabs for Tools Replaced by Title Bars
In the desktop, when you tab tools together, that is, arrange them so they
occupy the same position, the tools’ title bars share the title bar area. To
make a tool active, select its name in the title bar.
312
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
The Current Directory browser and Workspace browser are
"tabbed together".
The name of the tool in the title bar serves as the tab. To make a tool active, click its name in the title bar.
For example, click Workspace in the title bar to make the Workspace browser active.
For more information, see and “Tool Outside of Desktop and Other Tools
Grouped Inside Desktop Example” and “Grouping Desktop Tools Together”.
Compatibility Considerations. In previous versions, tools tabbed together
each had a tab at the bottom of the area they occupied. The tabs have been
removed in favor of tools sharing the titlebar area.
313
Version 7.4 (R2007a) MATLAB® Software
Multithreaded Computation Support Added; Enable Via New
Preference
If you run MATLAB on a multiple-CPU system (multiprocessor or multicore),
use a new preference to enable multithreaded computation. This can increase
performance in MATLAB for element-wise and BLAS library computations.
By default the preference is not set, so you must set it to enable multithreaded
computation. With the preference enabled, MATLAB automatically specifies
the recommended number of computational threads, although you can
change that value. On AMD platforms running the Linux operating system,
MATLAB supports multithreaded computation, but requires an extra step
to change the default BLAS.
If you are using a multiple-CPU system, you can run the Multithreaded
Computation demo to see the performance impact. For more information,
see “Enabling Multithreaded Computation” in the MATLAB Desktop
documentation.
Running Functions—Command Window and History
New features and changes introduced in Version 7.4 (R2007a) are
• “Startup Message Bar Replaces Startup Message in Command Window”
on page 314
• “Command History Searching Enhanced” on page 315
• “Macintosh Platforms—Some Key Bindings in Command Window
Changed” on page 315
Startup Message Bar Replaces Startup Message in Command
Window
When you start MATLAB, a getting started message bar appears at the top
of the Command Window, that provides links to information that is helpful
for new users. You can dismiss the message bar by using the close box in it.
Use Command Window preferences to specify whether or not the message
bar should appear.
314
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Command History Searching Enhanced
You can now find entries in the Command History window by typing the first
few letters of an entry; the previous entry that begins with those letters is
selected. Then use up and down arrow keys to extend the find to the next and
previous instances. Use the Ctrl key with an arrow key to select the current
as well as next or previous instances. Use Ctrl+A to find and highlight all
instances at once. The search does not look at entries in sessions that are
collapsed. For more information about this search feature, see “Finding Next
Entry By Letter”.
Macintosh Platforms—Some Key Bindings in Command
Window Changed
On Macintosh platforms, some key bindings were changed to make them more
consistent with Mac OS XMac OS X standard behaviors.
Compatibility Considerations. Key bindings you have been used to in the
Command Window might have changed.
Help
New features and changes introduced in Version 7.4 (R2007a) are
• “Demos Now Included in Search Results and Product Filtering” on page 315
• “Get URL of Displayed Page for Viewing on Web” on page 316
• “Include Search Database for Your Own Help Files” on page 316
• “Video Tutorials Now Accessed Via Web Site” on page 316
Demos Now Included in Search Results and Product Filtering
When you perform a search in the Help browser, the results now include
code and text found in Demos. Also, the Demos listing in the Help
Navigator pane now synchronizes with the demo currently open when you
have the synchronization preference for the Help browser selected. For more
information, see “Searching the Documentation”.
When you select File > Preferences > Help and enable the Product Filter,
only demos for selected products are shown in the Demos pane, and searched
via the Search for field.
315
Version 7.4 (R2007a) MATLAB® Software
Get URL of Displayed Page for Viewing on Web
When viewing a page in the Help browser, select View > Page Locations.
A window appears providing the location of the current Help page you are
viewing. The window provides the page location on both your local system
and the MathWorks Web site. Use this feature to
• Send the URL to someone else who wants to view that information and
might not have MATLAB or the same version of MATLAB, for example, a
colleague or technical support.
• More easily see if this same documentation page has been updated for
the latest product version.
Include Search Database for Your Own Help Files
If you create your own HTML help files for use with the MATLAB Help
browser, the Help browser can now search the content of your files. Create
a search database for your help files using the new builddocsearchdb
function. The function creates a helpsearch directory that contains the
search database files. For information on this process, see “Making Your
HTML Help Files Searchable”.
Compatibility Considerations. In previous versions of MATLAB, some
users created help search databases for their own help files via assistance
from MathWorks Technical Support. If you created a help search database for
use with R2006b, it might work in R2007a, but it is recommended that you
recreate it for R2007a, even if no content has changed. If you created a help
search database prior to R2006b, you must recreate it for R2007a.
Help search databases in prior releases were built from a help jar file rather
than html files. The builddocsearchdb function only supports html files.
However, it is expected to support jar files in a future release. If you used a
jar file for a prior version and want to use a jar file in R2007a, build your
R2007a help search database using the same technique you used in R2006b.
Video Tutorials Now Accessed Via Web Site
Previously video tutorials were installed when you installed MATLAB. Now
the tutorials are on the MathWorks Web site.
316
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Compatibility Considerations. You can still link to and play video tutorials
from within the Help browser Demos listings or other links to them in the
product and documentation, however this now requires an active Internet
connection.
Workspace, Search Path, and File Operations
New features and changes introduced in Version 7.4 (R2007a) are described
here.
Current Directory Browser Enhancements
• When you double-click a Windows shortcut in the Current Directory
browser, it runs the shortcut.
• When you double-click a prj file in the Current Directory browser, it opens
in the Deployment Tool.
• You can now find entries in the Current Directory browser by typing the
first few letters of an entry; the entry that begins with those letters is
selected.
Workspace Browser
When you double-click an object, it opens in the Property Inspector.
Array Editor Enhancements
You can now undo and redo the last operation you performed in the Array
Editor. This applies to cut, paste, insert, delete, and clear contents features.
Search Path Changes
On Windows platforms, MATLAB now adds the default startup directory, My
Documents\MATLAB (or Documents\MATLAB on Windows Vista), to the top of
the search path upon startup.
317
Version 7.4 (R2007a) MATLAB® Software
Compatibility Considerations. In previous releases, MATLAB added the
default startup directory, Work, to the bottom of the search path on Windows
platforms. For example, in R2006b, it added ...\MATLAB\R2006b\Work to the
bottom of the search path. In R2007a, for consistency with previous releases,
MATLAB adds ...\MATLAB\R2007a\Work to the bottom of the search path.
However, we encourage you to stop using the Work folder because support for
it might be removed in a future release. For more information, see “Changes
to Startup Directory (Folder) and Startup Options for MATLAB Application
on Windows” on page 302.
Editing and Debugging M-Files
New features and changes introduced in Version 7.4 (R2007a) are
• “Stand-Alone Editor No Longer Opens By Default; To Be Removed in a
Future Version” on page 318
• “Delimiter Matching Extended to Include Language Keyword Pairs” on
page 319
• “M-Lint Automatic Correction Feature” on page 319
• “M-Lint Detection of Missing End-of-Line Semicolons Enhanced” on page
320
• “Macintosh Platforms—Some Key Bindings in Editor/Debugger Changed”
on page 321
• “Other Changes in the Editor/Debugger” on page 321
Stand-Alone Editor No Longer Opens By Default; To Be
Removed in a Future Version
Starting in this release, by default, double-clicking an M-file in Windows
Explorer opens the file in the MATLAB Editor/Debugger rather than in the
MATLAB stand-alone Editor. In a future version, the stand-alone Editor
will not be provided with MATLAB.
Compatibility Considerations. The change to open M-files in the
MATLAB Editor/Debugger rather than the stand-alone Editor was
made based on many user requests. You can still use the MATLAB
stand-alone Editor in this release by starting the application located at:
matlabroot\bin\win##\meditor.exe.
318
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
Starting MATLAB by double-clicking an M-file requires a MATLAB license,
while starting the stand-alone Editor does not require a MATLAB license.
If you want to associate M-files so that when you double-click them they
open in the MATLAB stand-alone Editor rather than in the MATLAB
Editor/Debugger, follow the instructions in ; rather than specifying the
executable for MATLAB, matlab.exe, specify meditor.exe, which is in the
same folder.
Instead of the stand-alone Editor, you can use the MATLAB Editor/Debugger.
It provides all the features of the stand-alone Editor plus some not found in
the stand-alone Editor, such as debugging and tab completion; for a full list,
see “Stand-Alone Editor Will Not Be Included in Next Version” on page 266.
Some users have preferred the stand-alone Editor to the MATLAB
Editor/Debugger because of slightly better startup performance and because
it does not require a license for MATLAB. For those situations, you can use
any text editor you have, such as UltraEdit or Emacs. If you have concerns
about the pending removal of the stand-alone Editor, please contact us at
[email protected], so we can plan to minimize transition
issues.
Delimiter Matching Extended to Include Language Keyword
Pairs
You can now see the match to language keyword pairs using delimiter
matching features that previously existed for parentheses and brackets.
For example, when you type end, the Editor/Debugger highlights
the matching if. To set delimiter matching preferences, select
File > Preferences > Keyboard > Delimiter Matching; click Help for
more information.
M-Lint Automatic Correction Feature
For some types of warnings or errors, M-Lint can apply an automatic fix to
the code. Code that can be automatically corrected appears with a different
background color. To perform the fix, right-click the code that is highlighted
(for a single single-button mouse, use Ctrl+click); from the resulting context
menu, select the auto-fix action.
319
Version 7.4 (R2007a) MATLAB® Software
For more information, see step 8 in the example at “Automatically Analyzing
Code in the Editor”.
M-Lint Detection of Missing End-of-Line Semicolons Enhanced
In previous versions, there was a single output message generated by a line
with a missing terminating semicolon:
Terminate statement with semicolon to suppress output.
However, M-Lint suppressed displaying the message for files with three or
more cells (a cell being indicated by a line with an initial %%). This was done
based on the assumption that such files were demo programs, and therefore
display of the output was intentional.
In MATLAB Version 7.4 (R2007a), M-Lint no longer makes a distinction for
files with three or more cells. Instead, M-Lint displays one message for scripts
and a different message for functions:
Terminate statement with semicolon to suppress output (in functions).
Terminate statement with semicolon to suppress output (in scripts).
320
Desktop Tools and Development Environment, MATLAB® Version 7.4 (R2007a)
The corresponding M-Lint tags to suppress display of such messages within a
line are %#ok<NOPRT> for functions, and %#ok<NOPTS> for scripts.
By default, both of the messages are initially selected in Preferences.
Compatibility Considerations. In MATLAB Version 7.3 (R2006b),
%#ok<NOPRT> was the only tag used to suppress the missing terminating
semicolon. The tag will remain valid for function files, but will not be valid
for script files. If you added any %#ok<NOPRT> tags in script files in R2006b,
change those tags to the new tag %#ok<NOPTS>.
Macintosh Platforms—Some Key Bindings in Editor/Debugger
Changed
On Macintosh platforms, some key bindings were changed to make them more
consistent with standard behaviors for Mac OS X.
Compatibility Considerations. Key bindings you have been used to in the
Editor/Debugger might have changed.
Other Changes in the Editor/Debugger
• There is a new confirmation preference for displaying a warning about
exiting debug mode in order to save a file.
Tuning and Managing M-Files
There was a minor change in M-Lint behavior—for details, see “M-Lint
Detection of Missing End-of-Line Semicolons Enhanced” on page 320.
Compatibility Considerations
See the compatibility considerations associated with “M-Lint Detection of
Missing End-of-Line Semicolons Enhanced” on page 320.
Publishing Results
New features and changes introduced in Version 7.4 (R2007a) are
• “Publishing Function M-Files Now Supported” on page 322
321
Version 7.4 (R2007a) MATLAB® Software
• “Specify Maximum Number of Output Lines in Published File” on page 322
• “New Publishing Options” on page 322
Publishing Function M-Files Now Supported
You can now publish an M-file function. When publishing an M-file function,
you cannot evaluate the code. This feature effectively allows you to save M-file
functions to output formats such as HTML or Microsoft Word documents,
with formatting. To publish an M-file function, first clear the Evaluate
code preference in Editor/Debugger Publishing Preferences, or run the
publish function with the evalCode option set to false.
Specify Maximum Number of Output Lines in Published File
Using the publish function, you can specify the maximum number of lines in
a published file. Set the new maxOutputLines field to a nonnegative value.
The default value is Inf.
New Publishing Options
New publishing options provide increased flexibility and control over the
appearance of the published document. The added options are for adding
inline links, inline links with link text, graphics, and HTML markup. See
“Marking Up MATLAB Comments for Publishing” for more information.
322
Mathematics, MATLAB Version 7.4 (R2007a)
Mathematics, MATLAB Version 7.4 (R2007a)
New features and changes introduced in this version are:
• “New Functions” on page 323
• “More Efficient Matrix Multiplication for Sparse Matrices” on page 323
• “rand Function Uses the Mersenne Twister Algorithm as Default” on page
323
• “Upgrade to BLAS Libraries” on page 325
• “mode of Empty Array Now Returns NaN” on page 325
• “Change to Syntax for Setting BLAS Library Version on Linux” on page 325
New Functions
Function
Description
bsxfun
Applies an element-by-element binary operation to
two full arrays with singleton expansion enabled
ilu
Performs the sparse incomplete LU factorization
More Efficient Matrix Multiplication for Sparse
Matrices
Matrix multiplication for A'*b now handles sparse matrices more efficiently.
rand Function Uses the Mersenne Twister Algorithm
as Default
The rand function now uses the Mersenne Twister algorithm as default
generator algorithm. This method generates double precision values in the
closed interval [2^(-53), 1-2^(-53)], with a period of (2^19937-1)/2. Prior to
this release, MATLAB used an algorithm known as the Subtract-with-Borrow
(SWB) algorithm.
The rand function now produces different results than in previous releases.
However, the results returned are still pseudorandom values drawn from a
323
Version 7.4 (R2007a) MATLAB® Software
standard uniform distribution. Because the values returned by rand are
intended to be random, this change should not affect your code.
Compatibility Considerations
There are several things to keep in mind regarding this change:
• If your code requires the exact values returned by rand in previous releases,
you should use the statement
rand('state',0);
to reset rand to use the SWB algorithm. The new default algorithm’s
internal state at startup is equivalent to using the statement
rand('twister',5489);
Note that the 'state' keyword corresponds specifically to the SWB
algorithm; it cannot be used generally to refer to the internal state of the
currently active algorithm.
• Existing code that uses the 'state' keyword to reinitialize rand in a
statement such as
rand('state',sum(100*clock))
causes rand to switch to using the SWB algorithm. You may want to use
the 'twister' keyword, which resets rand but does not switch algorithms.
• Existing code that uses the 'state' keyword to save and restore the
internal state of rand in statements such as
savedState = rand('state');
...
rand('state',savedState);
% code that uses rand
may no longer work as intended. Specifically, the first line of code saves
the state of the SWB generator algorithm (see the rand documentation for
details). If the default Mersenne Twister algorithm was the active one at
that time, then using the saved state in the last line does not restore the
rand internal state to its original conditions. Instead, it switches the rand
324
Mathematics, MATLAB Version 7.4 (R2007a)
algorithm to SWB. To save and restore the internal state of the Mersenne
Twister algorithm, use the 'twister' keyword.
Upgrade to BLAS Libraries
MATLAB now uses new versions of the Basic Linear Algebra Subroutine
(BLAS) libraries. For Windows, Intel Mac, and Intel processors on Linux
platforms, MATLAB supports the Intel Math Kernel Library (MKL) version
9.0. For AMD processors on Linux platforms, MATLAB uses the AMD Core
Math Library (ACML) version 3.5. For the Solaris platform, MATLAB uses
the Sun Performance Library from Sun Studio 11.
mode of Empty Array Now Returns NaN
The mode function, when operating on an empty array ([]), returns a 1-by-0
array in previous releases, while related functions mean, median, std, and var
return NaN when given the same input. In this release, mode returns NaN for
an empty array input.
Compatibility Considerations
Existing program code that relies on mode of an empty array to return an
empty array should be modified.
Change to Syntax for Setting BLAS Library Version
on Linux
If you change the BLAS library used by MATLAB on Linux platforms,
MATLAB now loads libraries in the left-to-right order specified in the syntax.
For example, to load the Intel MKL BLAS, from a system prompt, run
setenv BLAS_VERSION mkl.so:mklcompat.so
MATLAB loads mkl.so first, and then loads mklcompat.so.
This also applies if you edit bin\$(ARCH)\blas.spec directly.
Compatibility Considerations
This syntax differs from that used for Linux platforms in prior versions.
325
Version 7.4 (R2007a) MATLAB® Software
Data Analysis, MATLAB Version 7.4 (R2007a)
There were no new features or changes in this version.
326
Programming, MATLAB Version 7.4 (R2007a)
Programming, MATLAB Version 7.4 (R2007a)
New features and changes introduced in this version are:
• “New Functions” on page 327
• “Parse Inputs with Consistently Implemented Mechanism” on page 328
• “textscan Returns Like Values in Same Cell Array” on page 328
• “Numbered Arguments for Formatted String Functions” on page 328
• “The dir Function Returns Additional datenum Field” on page 329
• “Using whos -file on Objects with Overloaded size or class Methods” on
page 330
• “mat2str Returns Correct Output for Strings” on page 330
• “Warning Generated by try-catch” on page 331
• “save -regexp Saves to Correct Filename” on page 332
• “Functions Not Callable If in Directory Under Class Directory” on page 332
• “Improved Performance on Certain Platforms and Operations” on page 333
• “Technique to Conserve Memory on Windows Vista” on page 333
• “ispuma Function Deprecated” on page 334
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
327
Version 7.4 (R2007a) MATLAB® Software
Function
Description
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 “Validating Inputs with Input Parser” 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 extra task of sorting through the
output and merging like data types together in your own code.
For more information, see the textscan function reference page.
Numbered Arguments for Formatted String Functions
Using numbered argument specification with MATLAB functions that employ
format specifiers such as %d or %s (e.g., sprintf, error), you can pass the
numeric and character string values that correspond to these format specifiers
in a varying order. This can be useful when translating format strings in a
different sentence structure.
328
Programming, MATLAB Version 7.4 (R2007a)
In addition to identifying the values, you can also use numbered arguments to
specify the field width and precision of the format specifiers. In the following
example, the first format specifier in the sprintf command is %1$*4$f (quite
different from the usual %f specifier). The 1$ tells MATLAB that the value
that is to replace this format specifier is in the first argument following the
format string; that is, 123.45678. The *4$ indicates that the field width for
this specifier is being passed in the fourth argument following the format
string: 15.
In the second and third arguments (%2$.*5$f and %3$*6$.*7$f), the symbols
2$ and 3$ represent the values, *5$ and *7$ represent precisions, and *6$
represents field width:
sprintf('%1$*4$f
%2$.*5$f
%3$*6$.*7$f', ...
123.45678, 16.42837, pi, 15, 3, 6, 4)
ans =
123.456780
16.428
3.1416
For more information, see “Formatting Strings” in the MATLAB Programming
documentation.
The dir Function Returns Additional datenum Field
The dir function now returns the date the file or directory was last modified
in two formats: string and numeric. The numeric date value is not specific to
any particular locale, and thus is compatible for international use:
fileinfo = dir('myfile.txt')
fileinfo =
name:
date:
bytes:
isdir:
datenum:
'myfile.txt'
'16-Mar-2006 13:34:01'
251
0
7.3275e+005
This new output is also returned when running dir on an FTP server.
329
Version 7.4 (R2007a) MATLAB® Software
Using whos -file on Objects with Overloaded size or
class Methods
MATLAB is unable to determine the true size of an object stored in a MAT-file
if the class of this object overloads the MATLAB size function. Likewise,
MATLAB cannot determine the true class name of an object if it overloads
the MATLAB class function. For these reasons, in previous versions of
MATLAB, the command whos -file does not return or display object size and
class accurately if the class of that object overloads these methods, but instead
always returns 1x1 for the size and a default name for the class.
In this release, whos -file returns the empty matrix ([]) or displays a
hyphen (-) for objects that overload size, and returns and displays unknown
for objects that overload class.
Compatibility Considerations
If you use whos -file on objects in any of your programs, and if any of these
objects overloads the size function, then you need to be aware that MATLAB
now returns [] instead of a 2–element vector of ones in the size field of the
output structure.
mat2str Returns Correct Output for Strings
The documentation for the mat2str function states that the str output of
this function “is suitable for input to the eval function such that eval(str)
produces the original matrix to within 15 digits of precision.” The behavior of
mat2str when given a character array as input, however, did not abide by
this rule. This inconsistency has been fixed in this release.
In MATLAB Version 7.3, the eval command below generated an error.
s = mat2str('MATLAB')
s =
'MATLAB'
eval(s)
ans =
MATLAB
330
Programming, MATLAB Version 7.4 (R2007a)
Compatibility Considerations
You might have to modify M-file programs that expect the previous behavior
from mat2str.
Warning Generated by try-catch
To accommodate future changes in the MATLAB error-handling capabilities,
there is a new restriction to the syntax of the try-catch block. When the first
MATLAB statement that follows the try keyword consists of just a single
term (e.g., A as opposed to A+B) occurring on the same line as the try, then
that statement and the try keyword should be separated by a comma. For
example, the line
try A
should be written as either
try, A
or on two lines as
try
A
This affects only single-term statements. For example, the following
statement continues to be valid:
try A+B
The same holds true for the catch keyword and a single-term statement
following the keyword on the same line. A valid try-catch statement of this
type should be composed as follows:
try, A, catch, B, end
If you omit the commas following try and/or catch, your code will continue to
operate correctly. However, MATLAB will issue a warning:
try statements, catch statements, end
Warning: This try-catch syntax will continue to work in R2007a,
but may be illegal or may mean something different in future
331
Version 7.4 (R2007a) MATLAB® Software
releases of MATLAB.
As with previous releases, the recommended syntax for a try-catch block
is as follows:
try
try_statements
catch
catch_statements
end
Note Due to a bug in the R2007a release, the warning for a catch followed
immediately by a single term is thrown as an error, even though the text of
the message says that it is a warning.
Compatibility Considerations
Your M-file programs may generate the warning shown above if the correct
syntax for try and catch is not used.
save -regexp Saves to Correct Filename
In previous releases, the following command mistook the -regexp argument
([ab] in the case shown below) to be the name of the file to save to:
save -regexp [ab]
In this release, the filename is correctly understood to be the default save
filename, matlab.mat, and any arguments that follow the -regexp flag and
precede the next flag are interpreted as patterns to be matched.
Functions Not Callable If in Directory Under Class
Directory
M-files placed in a directory that is one or more levels beneath a MATLAB
class directory are not callable from that same directory. A MATLAB class
directory contains methods of a class and has a filename that begins with
the @ character.
332
Programming, MATLAB Version 7.4 (R2007a)
In the following example, function myfun1 is not callable if the current
working directory is set to dir1. The same holds true for myfun2 if the current
working directory is set to dir2.
\home\matlab\@myobj\dir1\myfun1.m
\home\matlab\@myobj\dir1\dir2\myfun2.m
This behavior existed in the R2006b release, as well as in this release.
Compatibility Considerations
You will no longer be able to call a file that is one or more levels beneath
a MATLAB class directory if your current working directory is set to that
same directory.
Improved Performance on Certain Platforms and
Operations
As of release R2006b, 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.
Technique to Conserve Memory on Windows Vista
To conserve memory on machines running Windows Vista, you can reduce
the amount of virtual memory space reserved by the operating system by
using the command:
BCDEdit /set increaseuserva 3072
More documentation on this option can be found at the following URL:
http://msdn2.microsoft.com/en-us/library/aa906211.aspx
333
Version 7.4 (R2007a) MATLAB® Software
ispuma Function Deprecated
Because MATLAB no longer supports OSX 10.1, the ispuma function always
returns false in this release, and also displays a warning message that the
function is now deprecated. Support for ispuma will be removed in a future
release of MATLAB.
Compatibility Considerations
It is recommended that you remove calls to ispuma from your M-file functions.
334
Graphics and 3-D Visualization, MATLAB® Version 7.4 (R2007a)
Graphics and 3-D Visualization, MATLAB Version 7.4
(R2007a)
New features and changes introduced in this version are:
• “Nudging Annotations with Arrow Keys” on page 335
• “Movies No Longer Play During Loading” on page 335
• “Ghostscript Printing Software Upgraded” on page 336
• “Property Inspector Now Categorizes Graphic Object Properties” on page
336
• “Figure WindowScrollWheelFcn Property Programs Scrollwheel Events”
on page 338
• “Figure KeyReleaseFcn Property Programs Key Release Events” on page
338
Nudging Annotations with Arrow Keys
In plot edit mode, annotations such as textboxes, lines, arrows, doublearrows,
and text now respond to pressing directional arrow keys. Each keypress will
move the selected annotation(s) one or more pixels in the indicated direction.
If you select multiple objects, they all move together in response to arrow key
strokes. Normally, selected objects move one pixel with each press of an arrow
key. If you have selected Snap to Layout Grid from the Tools menu, each
keypress makes objects move to the next grid position.
Movies No Longer Play During Loading
The movie function no longer plays each frame one extra time. Previously,
it would show frames as they were loaded into memory to speed up display.
This behavior is no longer required and has been eliminated.
Compatibility Considerations
If you have code that calls movie in a loop a certain number of times and want
that number to remain the same, you need to add one iteration to the loop.
335
Version 7.4 (R2007a) MATLAB® Software
Ghostscript Printing Software Upgraded
The Ghostscript software used by some print devices has been upgraded from
an older version to Version 8.54. Starting in this release, MathWorks is no
longer shipping a separate, standalone Ghostscript executable program.
Compatibility Considerations
If you have written M-code based on undocumented functions that called the
old version of Ghostscript, your code will no longer work.
As a consequence of this upgrade, support for printing on DEC LN03 printers
(print dln03) has been removed from MATLAB.
Property Inspector Now Categorizes Graphic Object
Properties
The Property Inspector (accessed via the Property Editor, GUIDE, and
the inspect function) now provides tree views of groups of graphic object
properties as well as an alphabetical list of all properties. You can switch
between views via the two buttons at the top of the window, as shown in the
following picture of the tree view of the Printing category:
336
Graphics and 3-D Visualization, MATLAB® Version 7.4 (R2007a)
In addition, the type of object currently being inspected is now shown in the
title bar of the Property Inspector window. Formerly it was shown in the gray
area below the title bar, which now contains the view manipulation buttons.
To change view, click a button without the blue background (the collapse
and expand buttons at right are disabled in alphabetic list view). When you
change views, the selected property stays the same. To inspect properties of
graphic objects in the tree view, click the + icon next to a category of interest.
Do the same to open properties within a category that have multiple elements.
337
Version 7.4 (R2007a) MATLAB® Software
Note that only Handle Graphics objects have categories; annotation and most
other MATLAB objects can be displayed only in alphabetic list view.
The functionality of the Property Inspector has not changed; only its GUI has.
As previously, if you select a set or array of objects and inspect them, the
Property Inspector only displays those properties that all the objects share.
For details on using the Property Inspector, see “Accessing Object Properties
with the Property Inspector” in the MATLAB Graphics documentation and
the inspect reference page.
Compatibility Considerations
Text that you type or delete after clicking a text field that has a text widget
icon (for example, XTickLabel), will not persist unless you press Return
before clicking elsewhere. This mimics the behavior of clicking the text widget
icon to open a text entry dialog box, typing into it, and accepting the result by
clicking OK. This behavior differs from that which existed prior to R2006b
(MATLAB V. 7.3).
Figure WindowScrollWheelFcn Property Programs
Scrollwheel Events
The new figure property WindowScrollWheelFcn enables you to write a
callback function that handles mouse wheel scrolling events while the figure
has focus. See the documentation for the figure WindowScrollWheelFcn for
more information.
Figure KeyReleaseFcn Property Programs Key
Release Events
The new figure property KeyReleaseFcn enables you to write a callback
function that handles key release events (analogous to KeyPressFcn). See the
documentation for the figure KeyReleaseFcn for more information.
338
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.4 (R2007a)
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.4 (R2007a)
New features and changes introduced in this version are:
• “GUIDE No Longer Copies Callbacks When You Duplicate Components”
on page 339
• “GUIDE M-File-Defined handles Structure Fields No Longer Become
Permanent” on page 339
• “UNIX: File Dialog ’Location’ Property Is Obsolete” on page 340
• “Functions Becoming Obsolete” on page 340
GUIDE No Longer Copies Callbacks When You
Duplicate Components
In GUIDE, when you copy a component for which one or more of its callback
properties are defined, the callback properties of the newly created component
are now set to their default values, the ones you get when adding a component
directly from the Component Palette. Previously, their values were copied
from the corresponding callback properties of the original component. New
callback subfunctions can be generated in the GUI M-file for the new
component in the same way as for any component in the GUIDE layout.
Compatibility Considerations
If you have relied on the old behavior, in which the callbacks properties of the
new component point to the callbacks of the original component, you will
now have to explicitly change the callback properties, using the Property
Inspector, to do that.
GUIDE M-File-Defined handles Structure Fields No
Longer Become Permanent
The handles structure that is provided to every GUIDE generated callback
subfunction in the GUI M-file is constructed at runtime every time the GUI
runs. When the GUI is fully initialized, the handles structure contains
only handles to all the components in the GUI and custom data added in
339
Version 7.4 (R2007a) MATLAB® Software
any CreatedFcn callbacks and/or the OpeningFcn. Previously, fields that
the M-file had added to the handles structure could sometimes become a
permanent part of the structure.
Compatibility Considerations
If your GUI runs well but displays error messages about missing fields in the
handles structure when starting up, you may have to update the code in the
GUI M-file where those fields are accessed. You may need to initialize those
handles fields properly in a CreateFcn callback and/or in the OpeningFcn.
UNIX: File Dialog ’Location’ Property Is Obsolete
For UNIX platforms, the Location property of uigetfile and uiputfile is
obsolete. Previously, for UNIX platforms only, you could use the Location
property to specify the screen location at which the dialog box would originally
be displayed.
Compatibility Considerations
Since the UNIX uigetfile and uiputfile Location property is now obsolete,
MATLAB ignores any occurrences in existing code of the Location property
uigetfile(...,'Location',[X Y])
or the older use of X and Y arguments to specify location
uigetfile(...,X,Y)
A warning is displayed for either syntax, on all platforms.
Functions Becoming Obsolete
The following functions are either obsolete or grandfathered in MATLAB 7.4
(R2007a): cshelp, figflag, getstatus, menulabel, popupstr,setstatus,
hidegui, uigettoolbar.
Compatibility Considerations
The functions shown in the following table will continue to work but their
use may generate a warning message. As soon as possible, replace any
340
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.4 (R2007a)
occurrences you may have of these functions with the function(s) shown in the
following table, if any, or with other suitable code.
Function
Replacement
cshelp, figflag,
getstatus,
menulabel,
popupstr,
setstatus
Grandfathered. There are no replacements. No
enhancements will be made and only critical bugs
will be fixed. No warnings will be displayed. These
functions may become obsolete if replacements become
available.
hidegui
Obsoleted. Now issues warnings. Set the figure
HandleVisibility property instead.
uigettoolbar
Obsoleted. No warnings will be displayed until a
replacement is available in a future release.
341
Version 7.4 (R2007a) MATLAB® Software
External Interfaces/API, MATLAB Version 7.4 (R2007a)
• “New File Extensions for MEX-Files” on page 342
• “MEX-Files Built in MATLAB R11 or Earlier Must Be Rebuilt” on page 343
• “Changes to Compiler Support” on page 343
• “New COM Features” on page 347
• “Changes to Handling Microsoft® ActiveX Methods” on page 348
New File Extensions for MEX-Files
MEX-Files in MATLAB for Apple Macintosh (Intel)
With the introduction of MATLAB for Macintosh (Intel), the MEX-files you
build have the extension .mexmaci. The mexext command in MATLAB
returns mexmaci for Macintosh (Intel).
Compatibility Considerations. MEX-files built using MATLAB for
Macintosh PowerPC®, which have.mexmac extensions, cannot be used in
MATLAB for Macintosh (Intel).
Note All MEX-files on Macintosh platforms need to be recompiled for
R2007a.
MEX-Files in MATLAB for 64–bit Sun Solaris SPARC
With the introduction of MATLAB for 64–bit SolarisSPARC, you can now
build 64-bit MEX-files for the Solaris platform. These MEX-files have the
extension .mexs64. The mexext command in MATLAB returns mexs64 for
Solaris SPARC.
Compatibility Considerations. MEX-files built using MATLAB for Solaris
32, which have.mexsol extensions, cannot be used in MATLAB for Solaris
SPARC.
342
External Interfaces/API, MATLAB® Version 7.4 (R2007a)
Note All MEX-files on Solaris 64 platforms need to be recompiled for R2007a.
MEX-Files Built in MATLAB R11 or Earlier Must Be
Rebuilt
In order to work with MATLAB V7.4 (R2007a), MEX-files compiled on
Microsoft Windows (32–bit) platforms with MATLAB R11 or earlier will no
longer load correctly and must be recompiled. These files can be compiled
with MATLAB R12 or later.
Changes to Compiler Support
The set of compilers that MATLAB supports has changed in MATLAB Version
7.4 (R2007a). For an up-to-date list of supported compilers, see the Supported
and Compatible Compilers Web page.
• “New Compiler Support” on page 343
• “Fortran Compatibility Considerations” on page 345
• “Discontinued Compiler Support” on page 345
• “Compiler Support To Be Phased Out” on page 346
• “Additional Linker Support for Intel Fortran” on page 346
New Compiler Support
MATLAB V7.4 (R2007a) supports new compilers for building MEX-files.
Windows (64-bit) platform.
• Intel C++ version 9.1
• Intel Visual Fortran version 9.1
Windows (32-bit) platform.
• Intel C++ version 9.1
• Intel Visual Fortran version 9.1
343
Version 7.4 (R2007a) MATLAB® Software
• Microsoft Visual C++ 2005 version 8.0 Express Edition
Note If you use the mex -f
matlabroot/bin/$ARCH/mexopts/msvc80freeopts.bat switch to build a
MEX-file using Microsoft Visual C++ 2005 Express Edition, the environment
variable MSSdk must be defined. The value of this environment variable
is the path to the installation directory for Microsoft Platform SDK for
Windows Server 2003. (Microsoft Visual C++ 2005 Express Edition requires
Microsoft Platform SDK for Windows Server 2003.)
Macintosh PowerPC and Macintosh (Intel) platforms.
• Apple Xcode 2.4.1 (gcc / g++ version 4.0.1)
• g95 version 0.90
Note All MEX-files on Macintosh platforms need to be recompiled for
R2007a.
Linux (64-bit) platform.
• gcc / g++ version 4.1.1
• g95 version 0.90
Linux (32-bit) platform.
• gcc / g++ version 4.1.1
• g95 version 0.90
Note All Fortran MEX-files compiled on Linux platforms need to be
recompiled for R2007a.
344
External Interfaces/API, MATLAB® Version 7.4 (R2007a)
SolarisSPARC (64-bit) platform.
• cc / CC version 5.8
• gcc / g++ version 3.2.3
• f90 version 8.2
Fortran Compatibility Considerations
In R2007a we have added support for a new Fortran compiler g95 on the
Linux and Macintosh platforms. This compiler implements the Fortran 95
language standard. It replaces previously supported Fortran compilers which
implemented a previous language standard.
This may cause incompatibilities in your Fortran source code for MEX-files.
Refer to the IBM XL Fortran V10.1 for Linux Language standards Web site
http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101
/index.jsp?topic=/com.ibm.xlf101l.doc/xlflr/languagestandards.htm
for information about incompatibilities between language standards.
Discontinued Compiler Support
The following compilers are no longer supported.
Linux (64–bit) platform.
• gcc / g++ version 3.4.5
• g77 version 3.4.5
Linux (32–bit) platform.
• gcc / g++ version 3.4.5
• g77 version 3.4.5
Macintosh PowerPC platform.
• gcc / g++ version 3.3
• Absoft f77 / f90 version 8.2a
345
Version 7.4 (R2007a) MATLAB® Software
Compatibility Considerations. To ensure continued support for building
your C/C++ programs, consider upgrading to another supported compiler. For
an up-to-date list of supported compilers, see the Supported and Compatible
Compilers Web page.
Compiler Support To Be Phased Out
The following compilers are supported in Version 7.4 (R2007a) but will not be
supported in a future version of MATLAB.
Windows (32-bit) platform.
• Intel C++ version 7.1
• Intel Visual Fortran 9.0
• Borland C++Builder 6 version 5.6
• Borland C++Builder 5 version 5.5
• Borland C++ Compiler version 5.5
• Compaq Visual Fortran version 6.6
• Compaq Visual Fortran version 6.1
Additional Linker Support for Intel Fortran
MATLAB V7.4 (R2007a) supports new linkers for building MEX-files with
Intel Visual Fortran 9.0.
Windows (32-bit) platform.
• Microsoft Visual Studio .NET 2003
• Microsoft Visual Studio 2005
Windows (64-bit) platform.
• Microsoft Visual Studio 2005
• Microsoft Platform SDK for Windows Server 2003 (Build 1289 or later)
346
External Interfaces/API, MATLAB® Version 7.4 (R2007a)
New COM Features
Programmatically Connect to Instances of a COM Automation
Server
MATLAB can now programmatically connect to an instance of a COM
Automation server using the new actxGetRunningServer function.
Improve the Custom Interface API
Changes to the actxserver function allow you to create a COM Automation
server using a custom interface.
New COM Data Type Support
Additional COM data type support has been added. See “Handling COM Data
in MATLAB Software” for a description of supported data types.
Enhanced Support for COM Interface Events
MATLAB users can take full advantage of event interfaces provided by
COM Automation servers. This change is implemented in the events,
eventlisteners, isevent, registerevent, unregisterevent, and
unregisterallevents functions.
For an example of this feature, see “Responding to Interface Events from an
Automation Server”.
Get the Status of a MATLAB Automation Server
Using the enableservice function you can learn the current state of a
MATLAB Automation server. The function returns a logical value, where
logical 1 (true) means MATLAB is an Automation server and logical 0 (false)
means MATLAB is not an Automation server.
For example, if you type
enableservice('AutomationServer')
and MATLAB displays
347
Version 7.4 (R2007a) MATLAB® Software
ans =
1
then MATLAB is currently an Automation server.
Changes to MATLAB Version-Specific ProgID
A programmatic identifier, or ProgID, is used to create a COM component.
MATLAB’s version-specific ProgID Matlab.Application.N.M now let’s you
specify both a major and minor version number.
For example, to specify MATLAB version 7.4, use the ProgID
Matlab.Application.7.4.
Changes to Handling Microsoft ActiveX Methods
Beginning in MATLAB Version 7.4 (R2007a), an ActiveX® method with the
same name as a class is treated as a constructor and cannot be called in the
same way as an ordinary method.
In the following example:
myApp = actxserver('Excel.Application');
op = invoke(myApp.Workbooks, 'open', 'MyFile.xls');
Sheets = myApp.ActiveWorkBook.Sheets;
target_sheet = get(Sheets, 'item','Sheet1');
invoke(target_sheet, 'Activate');
Activesheet = myApp.Activesheet;
cellname = 'B2';
Range = Activesheet.cells.Range(cellname,cellname);
the term Range is both a function on the MATLAB path and a constructor
of the class Range. MATLAB tries to execute the function range, which
generates the error:
??? Error using ==> range
Too many input arguments.
Error in ==> MyScript at 8
Range = Activesheet.cells.Range(cellname,cellname);
348
External Interfaces/API, MATLAB® Version 7.4 (R2007a)
To get the property value, use the get function.
For example:
Range = get(Activesheet.cells, 'Range', cellname, cellname);
349
Version 7.3 (R2006b)
MATLAB Software
This table summarizes what’s new in Version 7.3 (R2006b):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports
Includes fixes
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.3
(R2006b)” on page 353
• “Mathematics, MATLAB Version 7.3 (R2006b)” on page 366
• “Data Analysis, MATLAB Version 7.3 (R2006b)” on page 372
• “Programming, MATLAB Version 7.3 (R2006b)” on page 373
• “Graphics and 3-D Visualization, MATLAB Version 7.3 (R2006b)” on page
382
351
Version 7.3 (R2006b) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.3
(R2006b)” on page 386
• “External Interfaces/API, MATLAB Version 7.3 (R2006b)” on page 388
352
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
Desktop Tools and Development Environment, MATLAB
Version 7.3 (R2006b)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 353
• “Desktop” on page 354
• “Help” on page 357
• “Workspace, Search Path, and File Operations” on page 358
• “Editing and Debugging M-Files” on page 359
• “Tuning and Managing M-Files” on page 363
• “Publishing Results” on page 365
Startup and Shutdown
New features and changes introduced in Version 7.3 (R2006b) are described
here.
Associate Files from MATLAB Program with Windows
Operating System Using New Utility
You can run a utility from the Help browser to associate .m, .mat, .fig,
.p, and .mdl files with the MATLAB program in the Microsoft Windows
operating system. After running the utility, you will be able to start MATLAB
by double-clicking any of those file types in Windows Explorer. You can still
use Windows Explorer Folder Options to perform these file associations, but
the utility makes the task more convenient. For details, see “Associating Files
with MATLAB on Windows Platforms”.
Redirect Output on UNIX Now Sends Errors to Shell
When you start MATLAB on platforms running The Open Group UNIX
operating system using the -nodesktop startup option, and you redirect
output, for example to a file, MATLAB now sends any errors to the shell,
while normal output goes to the redirect target. This change was made so that
353
Version 7.3 (R2006b) MATLAB® Software
redirection withMATLAB follows standard behavior for the UNIX operating
system.
For example:
matlab -nodesktop -"r magic(3), magi(5)" > test.txt
starts MATLAB in nodesktop mode, runs the statement magic(3) and writes
the output to test.txt. When MATLAB runs magi(5), execution fails and
MATLAB displays the error message in the shell.
Compatibility Considerations. In previous versions, MATLAB redirected
both output and error messages, so in the above example, MATLAB wrote the
output of magic(3) as well as the error message from magi(5) to test.txt.
If you have shell scripts that use > to redirect output, and you rely on errors
appearing in the output target, you need to modify the matlab startup
statements in those scripts.
To achieve the former behavior, that is, to redirect both output and errors
to the specified target, use that specific redirect syntax for your shell. For
example, in tcsh, use >&, as in
matlab -nodesktop -"r magic(3), magi(5)" >& test.txt
Desktop
New features and changes introduced in Version 7.3 (R2006b) are described
here.
M-Lint Preferences Added and Now Appear on M-Lint Panel
M-Lint preferences now appear on a new M-Lint panel. There are new M-Lint
preferences to disable specific messages or categories of messages, as well as
to save the settings for use in a later session. In addition, you can choose to
show or hide messages for the MATLAB Compiler product if the MATLAB
Compiler product is installed. These new M-Lint preferences apply to the
M-Lint code analyzer operating automatically in the Editor/Debugger as
well as to the M-Lint Code Check Report you run via the Current Directory
browser Directory Reports or Tools > M-Lint > Show M-Lint Report.
354
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
Compatibility Considerations. M-Lint preferences were previously
accessed via the Editor/Debugger Language settings for M.
355
Version 7.3 (R2006b) MATLAB® Software
Close All Documents and Close Selected Documents Feature
Added
When you have multiple documents open within a tool, such as M-files in the
Editor/Debugger, select File > Close to readily close selected files in that tool.
Alternatively, right-click the document bar to close all open documents or all
open documents except the selected document in that tool.
Accessibility Documentation Included
Accessibility features and assistive technologies are now part of the Desktop
documentation. In prior versions, they were documented in the general
Release Notes.
New Look and Feel on Linux and Solaris Platforms
MATLAB has a new look and feel on the Linux operating system from Linus
Torvalds and the Sun Microsystems Solaris operating system that affects
windows, decorations, color schemes, and responsiveness of the interface
in MATLAB.
Compatibility Considerations. All of the changes are cosmetic, except
for file dialog boxes, like Open file. The new file dialog boxes are more
conventional and easier to use than in previous versions, and there is no
loss in functionality.
Invalid info.xml File on Path Now Generates an Error
When MATLAB finds an info.xml file on the search path or in the current
directory, it assumes the file is intended to add information to the Start
button or the Help browser, and automatically validates the file against
the supported schema. If there is an invalid construct in the info.xml file,
MATLAB displays an error in the Command Window. The error is typically of
the form
XML-file failed validation against schema located in
...
XML-file name: full path to...\info.xml
and might appear when you start MATLAB, press the Start button, or in
other situations. For more information about the error and how to eliminate
it, see “Adding Your Own Toolboxes to the Start Button”.
356
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
Compatibility Considerations. In previous versions, MATLAB displayed a
warning when it encountered an invalid info.xml file.
Help
New features and changes introduced in Version 7.3 (R2006b) are described
here.
Exact Phrase and Wildcard Searching Added; Change to
Search Database
These improvements were made to the Help browser search feature. Note
that they are not supported on Japanese systems.
• Search Field Always Shown — The Search for field is now always in view
when the Help browser is open. The list of pages found appears in the
Search Results tab.
• Exact Phrase Searches for More Relevant Results — Find an exact phrase
by typing quotation marks around the search term. For example, "plot
tools" finds only pages that include plot tools together, but does not
find pages that include plot in one part of the page and tools in another
part of the page. You can specify more than one exact phrase in a search
term, such as "plot tools" "figure pallette".
• Wildcards (*) in Search Terms for Variations of a Word (Partial Word
Search) — Use the wildcard character (*) in place of letters or digits in your
search terms. For example, plot* finds various forms of the word plot,
such as plot, plots, and plotting, while p*t find those variations as
well as variations of print and part, among others. You can use multiple
wildcards in a word or search term.
• Boolean Operator Evaluation Order Changed — Boolean NOT operators in
search terms are now evaluated first, followed by ORs, and then ANDs. In
prior versions, Boolean operators were evaluated in left to right order.
Compatibility Considerations. The search enhancements were facilitated
by changing to a new type of database. As a result, any existing Help search
databases for non-Mathworks products will not work in R2006b and beyond.
The documentation still displays in the Help browser, but it is not included
in searches.
357
Version 7.3 (R2006b) MATLAB® Software
If you use Help browser documentation for non-MathWorks products with a
pre-R2006b search database, a message will display in the Help browser to
notify you that the documentation will not be included in searches. If you
want search to work for that documentation, contact the product provider to
request an R2006b-compatible search database.
If you provide documentation for the Help browser and want the
documentation to be included in the searches, you need to update the
helpsearch.db entry in the info.xml file to the helpsearch directory, and
prepare an R2006b-compatible help search database. This process is much
easier than in the past. For instructions, contact Technical Support.
Workspace, Search Path, and File Operations
New features and changes introduced in Version 7.3 (R2006b) are described
here.
Statistical Results in Workspace Browser
The Workspace browser includes new columns that automatically
display results of common statistical calculations: Minimum, Maximum,
Range, Mean, Median, Mode, Variance, and Standard Deviation. Use
View > Choose Columns to specify the columns to show.
See also File > Preferences > Workspace for associated preferences.
Open Larger Arrays in Array Editor
You can open larger arrays in the Array Editor. In previous versions, large
arrays would fail to open in the Array Editor.
358
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
Editing and Debugging M-Files
New features and changes introduced in Version 7.3 (R2006b) are
• “File Comparisons Tool Added” on page 359
• “M-Lint Enhancements for Suppressing Messages, and Showing Messages
for the MATLAB® Compiler Product” on page 361
• “Restore Breakpoints Using New dbstop Feature” on page 362
• “End Debugging Completely Using New dbquit(’all’) Option” on page 362
File Comparisons Tool Added
Use the new File Comparisons tool to highlight the differences between
two files. Open a file, select Tools > Compare Against, and then browse
to select the second file or drag it into the tool from the Current Directory
browser or Windows Explorer. The two files appear aligned in a window with
highlights and indicators for any lines that differ, as shown in this example.
For more information, see “Comparing Files and Folders”.
359
Version 7.3 (R2006b) MATLAB® Software
Use elements in the toolbar to exchange the left-right positions of the two files
and to specify the number of columns shown.
360
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
You can also run the File Comparisons tool from the desktop by selecting
Desktop > File Comparisons. Drag a file from the Current Directory
browser or Windows Explorer into the tool. Then drag the second file into
the tool.
M-Lint Enhancements for Suppressing Messages, and Showing
Messages for the MATLAB Compiler Product
These are the new features and changes to M-Lint:
• “General Enhancements—Japanese Messages, and Line Number in
Indicator Bar” on page 361
• “Suppressing M-Lint Messages” on page 361
• “Deployment Messages in M-Lint” on page 362
• “Compatibility Considerations” on page 362
General Enhancements—Japanese Messages, and Line Number in
Indicator Bar.
• On Japanese systems, messages now appear in Japanese.
• The messages that appear at the indicator bar now includes the line
number.
Suppressing M-Lint Messages. The M-Lint automatic code analyzer in
the Editor/Debugger now provides a few ways for you to suppress specific
messages and categories of messages:
• Ignore Specific Instance — Right-click at the underline for an M-Lint
message, and from the context menu, suppress just that instance. M-Lint
adds %#ok and a new message ID tag to the end of the line, which is the
syntax in MATLAB for suppressing an M-Lint message.
• Disable All Instances — Right-click at the underline for an M-Lint message,
and from the context menu, disable all instances of that message in all
files. This changes the preference setting for that message.
• Use Preferences to Disable All Instances — Select
File > Preferences > M-Lint, and disable specific messages or categories
of messages, which applies to all instances in all files. You can save the
361
Version 7.3 (R2006b) MATLAB® Software
settings to an M-Lint preference file. From the Editor/Debugger, you can
select the M-Lint preference file from the Tools > M-Lint menu.
The M-Lint Code Check report also uses the preferences and suppresses the
display of specific messages and categories of messages, per the preference
settings.
Deployment Messages in M-Lint. M-Lint now displays deployment
messages for the MATLAB Compiler product, such as MCC does not permit
the CD function, which appear if the MATLAB Compiler product is
installed and you select the M-Lint preference to Show MATLAB Compiler
deployment messages. You can also disable or enable all deployment
messages via the Editor/Debugger Tools > M-Lint menu. You can suppress
specific messages using the same methods as for other M-Lint messages.
Compatibility Considerations. M-Lint preferences were previously
accessed via the Editor/Debugger Language settings for M. See also “mlint
Message IDs Changed and %#ok Syntax Enhanced” on page 363
Restore Breakpoints Using New dbstop Feature
You can save the status of breakpoints to a MAT-file using s=dbstatus and
restore the breakpoint status at a later time by loading the MAT-file using
the new dbstop(s) option. For example, set breakpoints in collatz. Run
s=dbstatus to assign the breakpoint status to s; use the completenames
option to save absolute pathnames and breakpoint function nesting sequence.
Save s to a MAT-file by running, for example, save mydebugsession s. At a
later time, run load mydebugsession to restore s, and then run dbstop(s)
to restore the breakpoints.
End Debugging Completely Using New dbquit(’all’) Option
If you debug multiple files at once, you can exit debug mode for all files by
running dbquit('all'). If you debug file1 and step into file2, running
dbquit terminates debugging for both files. However, if you debug file3 and
also debug file4, running dbquit terminates debugging for file4, but file3
remains in debug mode until you run dbquit again. The new dbquit('all')
option ends debugging for both file3 and file4, and as dbquit does, ends
debugging for file1 and file2.
362
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
Tuning and Managing M-Files
New features and changes introduced in Version 7.3 (R2006b) are described
here.
File Comparison Directory Report Removed; Replaced by File
Comparison Tool
The File Comparison Report, one of the directory reports available in the
Current Directory browser, was removed.
Compatibility Considerations. The new File Comparisons tool replaces the
File Comparison Report. The tool provides the same functionality as the
report did, and adds new features. For details, see “File Comparisons Tool
Added” on page 359.
M-Lint Code Check Report Enhancements and Changes
You can indicate specific messages or categories of messages you want M-Lint
to report. For details, see “M-Lint Enhancements for Suppressing Messages,
and Showing Messages for the MATLAB® Compiler Product” on page 361.
Compatibility Considerations. In previous versions, the M-Lint Code
Check report showed all messages except those suppressed via a %#ok at the
end of a line. Now, the M-Lint Code Check report will show only the messages
that are enabled via M-Lint preferences.
mlint Message IDs Changed and %#ok Syntax Enhanced
The mlint function with the -id option returns message IDs using a new
form. For example, when you run
mlint('filename.m', '-id')
MATLAB Version 7.2 (R2006a) returns
L 22 (C 1-9) 2:AssignmentNotUsed : The value ...
whereas MATLAB Version 7.3 (R2006b) returns
L 22 (C 1-9): NASGU: The value ...
363
Version 7.3 (R2006b) MATLAB® Software
The %#ok syntax used in M-files to suppress the display of M-Lint messages
for a line has been enhanced to support multiple messages per line. For
example, given this line in an M-file,
data{nd} = getfield(flds,fdata{nd});
two M-Lint messages result:
34: 'data' might be growing inside a loop; ...
consider preallocating for speed.
34: Use dynamic fieldnames with structures instead of GETFIELD...
Type 'doc struct' for more information.
In MATLAB Version 7.2 (R2006a), M-Lint messages could only be suppressed
for the entire line:
data{nd} = getfield(flds,fdata{nd}); %#ok
In MATLAB Version 7.3 (R2006b), you can still use %#ok to suppress all
messages for the line, or you can add an ID tag to indicate the exact messages
to suppress. For example, this suppresses only the first message about data
growing inside a loop:
data{nd} = getfield(flds,fdata{nd}); %#ok<GFLD>
To suppress more than one message per line, separate the ID tags with a
comma. For example, this suppresses both messages:
data{nd} = getfield(flds,fdata{nd}); %#ok<GFLD,AGROW>
Compatibility Considerations. In previous versions, the message IDs
returned from mlint with the -id option, were of a form that included a
numeric identifier, followed by the category. If you rely on the exact ID
values, you will need to make modifications to use the new form.
If you use M-Lint in MATLAB Version 7.3 (R2006b) and then run those files a
previous version, M-Lint in the previous version ignores the tag and IDs that
follow the %#ok, and therefore suppresses all messages for that line, which
is the expected behavior for the previous version.
364
Desktop Tools and Development Environment, MATLAB® Version 7.3 (R2006b)
mlintrpt Option Added to Use Preference Settings File
The mlintrpt function now accepts a new option that applies the preferences
saved to an M-Lint settings file. It works with the file or dir syntax:
mlintrpt('fullpath_to_file', 'file', 'fullpath_to_configfile.txt')
mlintrpt('fullpath_to_dir', 'dir', 'fullpath_to_configfile.txt')
For example, create the file NoSemiSetting.txt by saving settings in
File > Preferences > M-Lint. Later, use the settings via preferences or
M-Lint in the Editor/Debugger, or via mlintrpt as in this example:
mlintrpt('lengthofline.m', 'file', 'I:\MATLABFiles\NoSemiSettings.txt')
which displays an M-Lint report in the MATLAB Web browser for the
lengthofline file in the current directory using the M-Lint settings in
I:\MATLABFiles\NoSemiSettings.txt.
Toolbar Refresh Button Removed
The Profiler included a refresh button
on the toolbar. This button has been
removed. It performed an action similar to the Refresh button that appears
in many of the Profiler reports, so use that button instead.
Publishing Results
notebook Setup Arguments Removed
In MATLAB 7.1 (R14SP3), the notebook function was enhanced to
automatically detect the version of the Microsoft Word application and
other required information. This feature changed the notebook -setup
syntax—arguments to specify the version of the Microsoft Word application
(wordversion, wordlocation, templatelocation) were no longer supported.
If you used those arguments, MATLAB ignored them and issued a warning.
Now in MATLAB 7.3 (R2006b), if you use those arguments, MATLAB errors.
Compatibility Considerations. If you use notebook with the wordversion,
wordlocation, and templatelocation arguments in any of your files (for
example, startup.m), remove them to prevent errors.
365
Version 7.3 (R2006b) MATLAB® Software
Mathematics, MATLAB Version 7.3 (R2006b)
New features and changes introduced in this version are:
• “New Functions” on page 366
• “max and min Now Use Magnitudes and Phase Angle for Complex Input”
on page 367
• “Additional Output from lu” on page 367
• “Upper and Lower Factors for chol and ldl” on page 367
• “Permutation Vectors with lu, luinc, ldl” on page 367
• “Two-Element Threshold for lu, spparms” on page 367
• “Lower Triangular Factors from symbfact” on page 368
• “Support for New Versions of AMD, COLAMD, CHOLMOD, UMFPACK”
on page 368
• “Sparse Arrays on 64-Bit Systems” on page 368
• “FFTW Upgraded to Version 3.1.1 in MATLAB” on page 369
• “Future Obsolete Functions” on page 370
• “Obsolete Functions” on page 370
• “max and min No Longer Return Warning Messages for Inputs with
Different Data Types” on page 371
New Functions
366
Function
Description
amd
Interface to the amd algorithm. This interface is
similar to that used in symamd, but is typically faster
than symamd.
bvpxtend
Forms a guess structure for extending the boundary
value problem solution
ldl
Full ldl factorization and solving for Hermitian
matrices
Mathematics, MATLAB Version 7.3 (R2006b)
max and min Now Use Magnitudes and Phase Angle
for Complex Input
For complex input, min and max are computed using the magnitude,
min(abs(x)) and max(abs(x)) respectively. In the case of equal magnitude
elements, the phase angle, min(angle(x)) and max(angle(x)), is now used.
Compatibility Considerations
In previous versions, min and max were computed using the magnitude, and
in the case of equal magnitude elements, the first element was used. This
behavior was indeterministic and not consistent with the sort function.
Code in previous releases that relied on the output of this functionality for the
case described above should be updated.
Additional Output from lu
The lu function returns an additional output that helps improve numerical
stability of sparse lu factorization.
Upper and Lower Factors for chol and ldl
Upper and lower triangular factors for chol and ldl improve performance
for sparse chol. Referencing the lower triangle and returning the lower
triangular factor is more memory efficient in the case of sparse chol.
Permutation Vectors with lu, luinc, ldl
Permutation vectors for lu, luinc, and ldl provide memory savings and,
for large data, a noticeable performance improvement. You can now store
permutation information in a single 1-by-N vector instead of an n-by-n matrix,
Two-Element Threshold for lu, spparms
A new two-element threshold for lu and spparms gives you more control over
sparse lu and sparse \ behavior.
367
Version 7.3 (R2006b) MATLAB® Software
Lower Triangular Factors from symbfact
Extra arguments exported for symbfact allow the return of the lower
triangular symbolic factor.
Support for New Versions of AMD, COLAMD,
CHOLMOD, UMFPACK
MATLAB 7.3 supports new versions of the following libraries:
368
Library Name
Version Supported in MATLAB 7.3
AMD
2.0
COLAMD
2.5
CHOLMOD
1.1
UMFPACK
5.0
Mathematics, MATLAB Version 7.3 (R2006b)
Sparse Arrays on 64-Bit Systems
The internal storage of sparse arrays on 64-bit systems has changed in the
R2006b release. This change should be invisible to most MATLAB users.
However, MEX-file programs that run on a 64-bit system and access sparse
arrays must be modified and recompiled in order to run on MATLAB Version
7.3. This applies to existing MEX-files and to any new MEX-files that you
write.
If you are affected by this change, you will need to take the following steps to
make your code compatible with the new sparse array format:
• Modify all sparse array declaration statements in MEX-files that are to run
on a 64–bit system so that they now use the mwSize and mwIndex types
instead of more specific type declarations such as int or INTEGER*4.
• Change any MEX code that assigns a negative value to a variable used
to hold a sparse array index or size. An example of this would be code
that temporarily uses an array index as a flag, assigning a -1 to it to mark
the index as unset. Do not try to cast negative int values to mwSize or
mwIndex. Instead, change your code to avoid using negative values.
• Recompile these MEX-files using the -largeArrayDims option
For a full description of what you will need to do, please read the section
“Sparse Arrays on 64-bit Systems” on page 389 in the MATLAB External
Interfaces release notes.
Compatibility Considerations
Existing MEX-files that run on 64-bit systems and access sparse arrays in
MATLAB will not operate correctly in MATLAB 7.3 unless the required
changes outlined above are made and the files are recompiled with the
-largeArrayDims option. New MEX-files that you create must also adhere to
these guidelines.
FFTW Upgraded to Version 3.1.1 in MATLAB
The version of FFTW used in MATLAB has been upgraded from 3.0.2 to 3.1.1
Please read the “Compatibility Considerations” on page 370 section, below.
Other changes in MATLAB FFTW support are:
369
Version 7.3 (R2006b) MATLAB® Software
• The default planner method is now estimate. Previously, hybrid was
the default.
• There are new syntaxes for importing from and exporting to the library’s
internal single- and double-precision wisdom databases. These are as
follows and are documented in the reference page for the MATLAB fftw
function:
-
str = fftw('dwisdom')
str = fftw('swisdom')
fftw('dwisdom', str)
fftw('swisdom', str)
Compatibility Considerations
FFTW version 3.1.1 does not support wisdom produced by previous versions
of the FFTW library. For this reason, FFTW wisdom that has been exported
from a previous version of MATLAB cannot be imported successfully in
MATLAB R2006b. Trying to import “old” wisdom results in a warning.
Future Obsolete Functions
The betacore function generates a warning message in R2006b but completes
successfully. This function will be made obsolete in a future release.
Compatibility Considerations
You should remove all instances of the betacore function from your M-file
program code. This function will not be supported in a future release of
MATLAB.
Obsolete Functions
The following uses of MATLAB functions are obsolete as of this release.
Attempts to use this functionality in the R2006a release generate a warning
message but complete successfully. In R2006b, these operations fail and
generate an error message.
• The following functions in their entirety: bvpval, quad8, table1, table8,
bessela
370
Mathematics, MATLAB Version 7.3 (R2006b)
• The sort function, when used with complex integer inputs
• The gt, ge, lt, and le functions, when used with complex integer inputs
• The beta function, when used with 3 inputs
• The gamma function, when used with 2 inputs
• The opts.cheb and opts.stagtol fields in the options structure of eigs
Compatibility Considerations
You will need to remove all instances that reference these functions at this
time. These functions are no longer supported in MATLAB.
max and min No Longer Return Warning Messages
for Inputs with Different Data Types
In MATLAB version 7.0 (Release 14), the functions max and min were changed
to return results of a different data type than in previous releases. This
behavior is described in “max and min Now Have Restrictions on Inputs
of Different Data Types” on page 562. This change in behavior produced
warning messages to assist you with diagnosing any resulting issues. In
R2006b, these warning messages no longer exist.
Compatibility Considerations
The warning messages for mixed-type inputs to the functions max and min are
no longer produced. Turning warning messages on will no longer display
messages for this behavior, and you will no longer be able to depend on the
messages for the diagnosis of problems.
371
Version 7.3 (R2006b) MATLAB® Software
Data Analysis, MATLAB Version 7.3 (R2006b)
New features and changes introduced in this version are:
• “Generate M-File Now Supports Basic Fitting and Data Statistics” on page
372
• “New Options for Working with Time Series Objects” on page 372
Generate M-File Now Supports Basic Fitting and
Data Statistics
The Generate M-File option on the File menu of MATLAB figure windows
now generates code that reproduces plot objects created with the Basic Fitting
Tool or the Data Statistics Tool. The generated M-file function accepts new
data as input and creates plot objects with the same graphics properties as
those in the generating figure. In addition, the M-file recomputes fits and
statistics for the new data. The code shows you how to program what you do
interactively with the Basic Fitting Tool or the Data Statistics Tool.
New Options for Working with Time Series Objects
• Time Series Tools are now easier to find. From the MATLAB Start button,
select MATLAB > Time Series Tools.
• Time series objects are now fully supported by the Array Editor. When
you open a timeseries object (using open or the Workspace browser), the
editor from Time Series Tools appears in the Array Editor.
• Time series objects can now be opened directly in Time Series Tools. Select
a timeseries object in the Workspace browser, right click, and choose
Open in Time Series Tools from the context menu.
• In Time Series Tools, you can now change subplot indices interactively.
Click on a plotted line in a time series view and drag and drop it from one
subplot to another. To create a new subplot, drag and drop the plotted
line below the bottom axes.
372
Programming, MATLAB Version 7.3 (R2006b)
Programming, MATLAB Version 7.3 (R2006b)
New features and changes introduced in this version are:
• “Saving to MAT-Files Larger than 2 GB” on page 373
• “Import Wizard Generates Import M-Code” on page 375
• “New Dynamic Regular Expression Syntax” on page 375
• “New Reserved MATLAB Keywords” on page 375
• “Enhancements to Display Generated by whos” on page 376
• “unique Function Returns First and Last Indices” on page 377
• “save Compression and Unicode Options Removed” on page 377
• “Warning Generated by try-catch” on page 378
• “Case-Sensitivity Warning Removed” on page 379
• “fprintf(0,...) Now Throws an Error” on page 379
• “Assigning Nonscalar Structure Array Fields to a Single Variable” on page
380
• “Comma Separators Not Required in Function Declaration” on page 381
• “Improved Performance on Certain Platforms and Operations” on page 381
Saving to MAT-Files Larger than 2 GB
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.
373
Version 7.3 (R2006b) MATLAB® Software
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
save -v4
Save to a MAT-file you can open in
MATLAB version 4
Available Is the
In
Default In
V4, V5
V5 and
Versions
Versions
later
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
Compatibility Considerations
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.
374
Programming, MATLAB Version 7.3 (R2006b)
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.
Import Wizard Generates Import M-Code
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.
New Dynamic Regular Expression Syntax
The new ([email protected]) 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.
New Reserved MATLAB Keywords
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:
Compatibility Considerations
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.
375
Version 7.3 (R2006b) MATLAB® Software
Enhancements to Display Generated by whos
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
vCell
5x7
2380
vComplex
6x2
192
double
vDouble
6x5x9
2160
double
vFuncHdl
1x1
16
vGlobal
0x0
0
vObject
1x1
248
vPersist
0x0
Attributes
cell
complex
function_handle
double
global
timer
0
double
persistent
vSparse
15x15
244
double
sparse
vStruct
1x3
804
struct
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.
376
Programming, MATLAB Version 7.3 (R2006b)
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:
save -v7 filename
You 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
377
Version 7.3 (R2006b) MATLAB® Software
can load into a MATLAB Version 6 or earlier. To save to a MAT-file without
compression or Unicode encoding, type
save -v6 filename
To 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).
Compatibility Considerations
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.
Warning Generated by try-catch
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
378
Programming, MATLAB Version 7.3 (R2006b)
end
Compatibility Considerations
Your M-file programs may generate this warning if correct syntax for try
and catch is not used.
Case-Sensitivity Warning Removed
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.
Compatibility Considerations
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.
fprintf(0,...) Now Throws an Error
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.
379
Version 7.3 (R2006b) MATLAB® Software
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.
Compatibility Considerations
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.
Assigning Nonscalar Structure Array Fields to a
Single Variable
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.
Compatibility Considerations
If any of your programs rely on this error being thrown, you will need to
modify those programs.
380
Programming, MATLAB Version 7.3 (R2006b)
Comma Separators Not Required in Function
Declaration
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)
Compatibility Considerations
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)
Improved Performance on Certain Platforms and
Operations
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.
381
Version 7.3 (R2006b) MATLAB® Software
Graphics and 3-D Visualization, MATLAB Version 7.3
(R2006b)
New features and changes introduced in this version are:
• “Plotting Tools Are Now Modular Desktop Components” on page 382
• “Version 6 Property Editor Has Been Removed” on page 382
• “New Desktop Printing GUI” on page 383
• “Zoom Mode Now Supports Mouse Scroll Wheel” on page 383
• “Data Cursor Text Can Now Be Programmatically Modified” on page 384
• “Customizing Zoom, Pan, and Rotate3D Data Explore Modes” on page 384
• “Improvements to MATLAB Graphics Documentation” on page 385
Plotting Tools Are Now Modular Desktop Components
The three MATLAB plotting tools (Figure Palette, Property Editor, and Plot
Browser) now function as desktop components like the Workspace Browser
and the Array Editor. They dock, however, not to the MATLAB desktop but
to a Figures window. Figures windows contain one or more figures, each of
which is accessible by a tab. Turning on any plotting tool changes your figure
group into a mini-desktop. You can undock, rearrange, tab, and resize the plot
tools within the mini-desktop, and their state will persist across MATLAB
invocations. There are just one set of plot tools for all your figures, but they
only operate on figures contained in the group; undocked figures are free of
the plotting tools until you redock them.
For more information see Plotting Tools – Interactive Plotting in the MATLAB
Graphics documentation.
Version 6 Property Editor Has Been Removed
The MATLAB Version 6 Property Editor, one of the Plotting Tools, is no
longer available. this means that the 'v6' switch for the propedit function
now produces an error instead of starting the version 6 property editor. The
error message is
??? Error using ==> propedit
382
Graphics and 3-D Visualization, MATLAB® Version 7.3 (R2006b)
The Version 6 property editor is no longer available. Sorry!
Compatibility Considerations
If you have code that calls the version 6 property editor, you will need to
modify it to use the modular plotting tools described above in “Plotting Tools
Are Now Modular Desktop Components” on page 382. The propedit function
remain otherwise the same.
New Desktop Printing GUI
Printing MATLAB figures has become easier as a result of combining the
Page Setup, Print Setup, and Print Preview dialogs into one tabbed Print
Preview dialog. You can now specify paper size, plot size and layout, color
and line weight, header text, rendering, and other printing characteristics in
this new dialog. The Page Setup and Print Setup dialogs still exist, and
the Print dialog that you call from File —> Print remains the same. The
Page Setup dialog is available on all platforms.
For more information, see Using Print Preview in the MATLAB Graphics
documentation and printpreview in the MATLAB function reference
documentation.
Compatibility Considerations
The Page Setup dialog no longer is available from the figure window
File menu. However, it does continue to exist; you can raise it using the
pagesetupdlg command. The old Print Preview dialog has been removed,
however. The old Print Setup dialog can be raised using the command
print -dsetup
When you dismiss the Print Setup dialog with OK, the settings you made
with it are saved, but nothing is printed at that time.
Zoom Mode Now Supports Mouse Scroll Wheel
If your mouse has a center scroll wheel, you can use it to zoom in and out of
axes, as well as by clicking and/or dragging.
383
Version 7.3 (R2006b) MATLAB® Software
You can zoom in by positioning the mouse cursor where you want the center
of the plot to be and either press the mouse button or rotate the mouse scroll
wheel away from you (upward). Zoom out by positioning the mouse cursor
where you want the center of the plot to be and either simultaneously press
Shift and the mouse button, or rotate the mouse scroll wheel toward you
(downward). Each mouse click or scroll wheel click zooms in or out by a factor
of 2.
Data Cursor Text Can Now Be Programmatically
Modified
You can now easily customize the text of datatips. The datacursormode
function lets you specify the contents and formatting of text displayed by
the data cursor tool. When the data cursor tool is active, you can use its
context (right-click) menu to edit or specify the text update function that
MATLAB executes to display datatips. For more information, see Data
Cursor — Displaying Data Values Interactively in the MATLAB Graphics
documentation and datacursormode in the MATLAB Function Reference
documentation.
Customizing Zoom, Pan, and Rotate3D Data Explore
Modes
You can now customize the behavior of data explore modes by modifying the
zoom, pan and rotate3d objects that are dereferenced as follows:
h = pan(figure_handle)
h = rotate3d(figure_handle)
h = zoom(figure_handle)
These syntaxes create mode objects that you can use to control the behaviors
of the explore tools. Among the effects you can achieve using these explore
mode objects are
• Allow, change, or inhibit a mode for a specified axes
• Create callbacks for pre- and post-buttonDown events
• Change callbacks dynamically
384
Graphics and 3-D Visualization, MATLAB® Version 7.3 (R2006b)
See pan, rotate3d, and zoom in the MATLAB Function Reference
documentation for details and examples.
Compatibility Consideration
Using mode objects can cause a forward incompatibility. In prior releases,
explore modes did not return an argument. Therefore, code such as the above
examples that you write to take advantage of the new API will not run in
MATLAB versions prior to R2006b. zoom, pan, and rotate3d code written for
previous MATLAB versions, however, will run as before (there is no backward
incompatibility).
Improvements to MATLAB Graphics Documentation
A new section in the Graphics User Guide, “Types of MATLAB Plots”, now
includes a gallery of graphs that catalogs the kinds of plots that you can
create using MATLAB graphics functions. There are two tables containing
labeled icons, one for “Two-Dimensional Plotting Functions”, and one for
“Three-Dimensional Plotting Functions”, classified by plot type. Clicking the
function name above any thumbnail plot in the gallery opens the reference
documentation for that function.
Reference pages for functions that create, edit, annotate, and save plots have
been enhanced in several ways:
• Thumbnail figures at the top of plotting functions and related GUI
reference pages illustrate what you see when you invoke these functions.
• GUI Alternatives sections above syntax descriptions describe how to invoke
a function (or similar capability) from a GUI, and provide links to relevant
topics in the Graphics and Desktop Tools User Guides.
• Revised printing documentation in user guides and reference pages (see
“New Desktop Printing GUI” on page 383, above)
• Numerous corrections and clarifications of details in user guides and
reference pages
385
Version 7.3 (R2006b) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.3 (R2006b)
New features and changes introduced in this version are:
• “Functions Are Now Obsolete” on page 386
• “Colored Buttons on Windows XP” on page 386
• “Documentation Enhancement” on page 387
Functions Are Now Obsolete
The following functions are obsolete in MATLAB 7.3 (R2006b): axlimdlg,
edtext, menubar, pagedlg, umtoggle.
Compatibility Considerations
The functions shown in the following table will continue to work but their use
will generate a warning message. As soon as possible, replace any occurrences
you may have of these functions with the function(s) shown in the following
table, if any, or with other suitable code.
Function
Replacement
axlimdlg
None
edtext
Set the Editing property of the text object.
menubar
Set the MenuBar property of the figure to none.
pagedlg
pagesetupdlg
umtoggle
Set the Checked property of the uimenu object.
Colored Buttons on Windows XP
Setting the background color of user interface control (uicontrol) push buttons
and toggle buttons on Windows XP now results in flat, colored buttons.
Compatibility Considerations
Prior to this release, if you set the background color of a push button or toggle
button to any color other than the factory color on Windows XP, the color
386
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.3 (R2006b)
displayed only as a border around the button. With this release, any such
buttons will display as flat, colored buttons with a simple border.
Documentation Enhancement
The Creating GUIs Programmatically section of the documentation now
contains information commensurate with information in the Creating GUIs
with GUIDE section. It adds, in workflow order, information and many basic
examples about:
• Adding components, menus, and toolbars to your GUI. Placing and aligning
components.
• Designing for cross-platform compatibility.
• Initializing the GUI and creating callbacks.
• Callback examples for the different components.
387
Version 7.3 (R2006b) MATLAB® Software
External Interfaces/API, MATLAB Version 7.3 (R2006b)
• “New Types for Declaring Size and Index Values” on page 388
• “Sparse Arrays on 64-bit Systems” on page 389
• “New MAT-File Format Based on HDF5” on page 390
• “-V5 Option to MEX to Be Removed” on page 391
• “Location of mex.bat File Changed” on page 391
• “Changes to Compiler Support” on page 391
• “Actxcontrol Command Now Validates ProgID” on page 391
New Types for Declaring Size and Index Values
Version 7.3 (R2006b) defines two new types for API arguments and return
values. These are
• mwSize — represents size values, such as array dimensions and number
of elements.
• mwIndex — represents index values, such as indices into arrays.
Using these types in array declarations replaces more specific type
declarations such as int or INTEGER*4. In general, using these types
consistently in your C or Fortran source files can insulate your code from
changes in the API implementation that might take place between different
versions of MATLAB.
The mwSize and mwIndex types are required when working with functions
that access sparse arrays on a 64-bit system. This is described in the release
note on “Sparse Arrays on 64-bit Systems” on page 389, below.
Note In Fortran, mwSize and mwIndex are implemented as preprocessor
macros. To use these types in Fortran code, add the declaration #include
"fintrf.h" in your source file and build your MEX-files using the Fortran
preprocessor.
388
External Interfaces/API, MATLAB® Version 7.3 (R2006b)
Sparse Arrays on 64-bit Systems
The internal storage of sparse arrays on 64-bit systems has changed in the
R2006b release. Due to this change, you will need to
• Change declaration statements in your source code so that you use the new
types mwSize and mwIndex in place of specific type declarations such as int
or INTEGER*4. This is described in the section “New Types for Declaring
Size and Index Values” on page 388, above.
• Recompile all MEX-files that interact with sparse arrays using the
new -largeArrayDims switch. For more information about the
-largeArrayDims switch, see the section “New MEX Switch” on page
389, below.
See the section on “Compatibility Considerations” on page 390 to find out
if you will need to make any modifications to your existing MEX code to
accommodate these changes.
Sparse API Functions Affected By This Change
You will need to recompile any MEX-files that use the following sparse
functions on a 64-bit system:
• mxGetIr
• mxGetJc
• mxSetIr
• mxSetJc
New MEX Switch
In order to build MEX-files that use any of the sparse array functions listed
above, you need to compile these files with the -largeArrayDims switch, as
shown here:
mex -largeArrayDims filename
Also, any existing MEX-files that interact with sparse arrays in MATLAB
Version 7.3 must be recompiled using the -largeArrayDims switch.
389
Version 7.3 (R2006b) MATLAB® Software
Note The -largeArrayDims option is likely to become the default in a future
version of MATLAB.
Compatibility Considerations
If you are using any of the functions listed above, then you should be aware
of the following potential compatibility issues if your MEX code uses sparse
arrays on a 64-bit system:
• In release R2006b, you must rebuild all MEX-files that use sparse arrays
using the new -largeArrayDims switch.
• Before building your MEX-files, change your C or Fortran sources to use
the mwSize or mwIndex types introduced in this release. See the mxArray
reference pages for the types to use for each function.
• MEX-files that compiled properly in Version 7.2 (R2006a) and do not use
sparse arrays should build and execute correctly in Version 7.3 (R2006b)
without changes.
• For more information on how the sparse API is affected, see the Sparse
Arrays on 64-Bit Systems section in the MATLAB Mathematics release
notes.
New MAT-File Format Based on HDF5
In Version 7.3 (R2006b), you can save MAT-files in a format based on HDF5.
Unlike earlier MAT-file formats, the HDF5-based format is capable of saving
variables that occupy more than 2 GB of storage, including large arrays
created on 64-bit systems.
To save a MAT-file in the HDF5-based format, use the -v7.3 option to the
MATLAB save function or the "w7.3" mode argument to the C or Fortran
matOpen function. The default MAT-file format is the same as that in Version
7.2 (R2006a).
Compatibility Considerations
Earlier versions of MATLAB cannot read MAT-files written in the
HDF5-based format.
390
External Interfaces/API, MATLAB® Version 7.3 (R2006b)
MAT-files written with MATLAB Version 7.3 (R2006b) on a 64-bit system can
be read back into MATLAB 7.3 on a 32-bit system, provided that none of the
values stored in the MAT-file require more than 32 bits to store.
-V5 Option to MEX to Be Removed
The -V5 option to mex is not supported in this and future versions of MATLAB.
Compatibility Considerations
You will no longer be able to build a MEX-file that is compatible with
MATLAB Version 5.
Location of mex.bat File Changed
In MATLAB Version 7.3, the Microsoft Windows script mex.bat is located in
the directory $MATLAB\bin.
Compatibility Considerations
You may need to change any scripts or environment variables that relied
on the previous location of mex.bat.
Changes to Compiler Support
Compaq Visual Fortran version 6.1 is supported in Version 7.3 (R2006b) but
will not be supported in a future version of MATLAB.
Compatibility Considerations
To ensure continued support for building your Fortran programs, consider
upgrading to another supported compiler. For an up-to-date list of supported
compilers, see the Supported and Compatible Compilers Web page.
Actxcontrol Command Now Validates ProgID
Attempting to insert a COM server into a MATLAB figure can
result in unpredictable behaviors. To prevent this condition, the
actxcontrol command now checks the ProgID by looking at the registry’s
HKR/CLSID/Control keyword and throws an error if the ProgID does not
belong to a Microsoft ActiveX control.
391
Version 7.3 (R2006b) MATLAB® Software
Compatibility Considerations
Before the validation check was added, some server ProgIDs worked with
actxcontrol , probably because there are cases where Microsoft software
points the server GUID to a control GUID underneath. An example of a
ProgID that might not work with actxcontrol is the Windows Media® Player
server ProgID Mediaplayer.mediaplayer.1. Therefore, depending on how
Microsoft software registers the control, the following command might now
return an error:
h = actxcontrol('Mediaplayer.mediaplayer.1'); % Returns an error
The correct ProgID to use for Mediaplayer is the ActiveX control ProgID:
h = actxcontrol('WMPlayer.OCX.7'); % Use control ProgID
Note that methods and properties to open and play files are different when
using the control ProgID.
You can disable the validation check with the following command:
feature('COM_ActxProgidCheck',0)
Or reenable it with:
feature('COM_ActxProgidCheck',1)
By default, ProgID checking is on.
392
Version 7.2 (R2006a)
MATLAB Software
This table summarizes what’s new in Version 7.2 (R2006a):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports at
Web site
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.2
(R2006a)” on page 395
• “Mathematics, MATLAB Version 7.2 (R2006a)” on page 409
• “Data Analysis, MATLAB Version 7.2 (R2006a)” on page 411
• “Programming, MATLAB Version 7.2 (R2006a)” on page 412
• “Graphics and 3-D Visualization, MATLAB Version 7.2 (R2006a)” on page
419
393
Version 7.2 (R2006a) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.2
(R2006a)” on page 421
• “External Interfaces/API, MATLAB Version 7.2 (R2006a)” on page 423
394
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
Desktop Tools and Development Environment, MATLAB
Version 7.2 (R2006a)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 395
• “Desktop” on page 396
• “Running Functions — Command Window and Command History” on page
397
• “Help” on page 398
• “Workspace, Search Path, and File Operations” on page 398
• “Editing and Debugging M-Files” on page 399
• “Tuning and Managing M-Files” on page 406
• “Publishing Results” on page 408
• “Source Control Interface” on page 408
Startup and Shutdown
New features and changes introduced in Version 7.2 (R2006a) are described
here.
Installation Directory Structure on Windows Platforms
The installation directory structure on Microsoft Windows platforms is
slightly different than in previous versions. By default, the structure now
includes a general MATLAB top level directory, with a subdirectory for R2006a.
The root directory for the MATLAB software returned by the matlabroot
function, is now of the form in this example:
D:\Applications\MATLAB\R2006a
In previous versions, the top-level directory included the version number, so
the root directory for MATLAB, as returned by the matlabroot function, was
of the form in this example:
D:\Applications\MATLAB 7.1
395
Version 7.2 (R2006a) MATLAB® Software
Compatibility Considerations. If you relied on the explicit root directory
structure for MATLAB in your code, change it to reflect the new structure
including the top-level MATLAB directory. The matlabroot function might
be useful.
Error Log Reporting
If MATLAB experiences a segmentation violation, it generates an error log.
Upon the next startup, MATLAB prompts you to e-mail the error log to
The MathWorks. The MathWorks uses the log to work on resolving the
problem. When you send a log, you receive a confirmation e-mail and will
only receive further e-mails if The MathWorks develops a fix or workaround
for the problem.
There are some situations where the Error Log Reporter does not open, for
example, when you start MATLAB with a -r option or run in deployed
mode. If you experience segmentation violations but do not see the Error Log
Reporter on subsequent startups, you can instead e-mail logs by following
the instructions at the end of the segmentation violation message in the
Command Window.
JVM Software Updated for 64-Bit Linux Platforms
The Sun Microsystems JVM software version that MATLAB uses is now
version 1.5.0_04 for 64-bit platforms running the Linux operating system
from Linus Torvalds.
Desktop
New features and changes introduced in Version 7.2 (R2006a) are described
here.
Preferences Reorganized and New Keyboard Pane Added to
Support Command Window and Editor/Debugger
Preferences includes a new pane, Keyboard, for setting key bindings, tab
completion, and delimiter-matching preferences for the Command Window
and Editor/Debugger. Most of these preferences were previously located in
the preference panes for the Command Window or Editor/Debugger.
396
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
Compatibility Considerations. You no longer access keyboard and
indenting preferences for the Command Window and Editor/Debugger from
the component preferences, but rather from the new Keyboard preferences.
In addition, some preferences that were set separately for these components
are now shared. For details about the changes, see “Keyboard and Indenting
Command Window Preferences Reorganized” on page 397, and “Keyboard and
Indenting Editor/Debugger Preferences Reorganized” on page 401.
Open All Desktop Tools from Desktop Menu
You can now open (and close) all desktop tools from the Desktop menu.
In previous versions, you could not access document-based tools from the
Desktop menu. The document-based desktop tools are: Editor/Debugger,
Figures, Array Editor, and Web Browser.
Access Login Renamed to MathWorks Account
Use Help > Web Resources > MathWorks Account menu items to go
to your MathWorks Account if you are registered, or to register online.
MathWorks Account was previously called Access Login.
Running Functions — Command Window and
Command History
New features and changes introduced in Version 7.2 (R2006a) are described
here.
Keyboard and Indenting Command Window Preferences
Reorganized
The Command Window Keyboard and Indenting preferences pane was
removed. The tab size preference is now on the Command Window
preferences pane. The tab completion, keybinding, and parentheses
matching preferences were moved to the new Keyboard preferences pane.
The parentheses-matching preferences are now called delimiter-matching
preferences and are shared with the Editor/Debugger.
397
Version 7.2 (R2006a) MATLAB® Software
Help
New features and changes introduced in Version 7.2 (R2006a) are described
here.
help for Model Files
You can now use the help function to get the complete description for
MDL-files. For example, run
help f14_dap.mdl
MATLAB displays the description of the F-14 Digital Autopilot High Angle
of Attack Mode model in the Simulink software, as defined in its Model
Properties > Description:
Multirate digital pitch loop control for F-14 control design
demonstration.
Workspace, Search Path, and File Operations
New features and changes introduced in Version 7.2 (R2006a) are described
here.
toolboxdir function added
The toolboxdir function returns the absolute pathname to the specified
toolbox. It is particularly useful with the MATLAB Compiler product because
the toolbox root directory is different than in MATLAB.
Visual Directory View Removed
The Visual Directory view was removed from the Current Directory browser.
Most of the features it provided are accessible from the Current Directory
browser standard view.
398
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
Editing and Debugging M-Files
New features and changes introduced in Version 7.2 (R2006a) are
• “Tab Completion — Tab Now Completes Function and Variable Names”
on page 399
• “Go Menu Added; Bookmark and Go To Items Moved from Edit Menu to Go
Menu” on page 400
• “Navigate Back and Forward in Files” on page 401
• “Keyboard and Indenting Editor/Debugger Preferences Reorganized” on
page 401
• “M-Lint Automatic Code Analyzer Checks for Problems and Suggests
Improvements” on page 401
• “Debugging Changes” on page 402
• “Cell Mode On by Default — Shows Cell Toolbar and Possibly Horizontal
Lines and Yellow Highlighting; Cell Information Bar and Button Added”
on page 403
• “Lines Between Cells” on page 405
• “Cell Titles in Bold Preference Removed” on page 405
Tab Completion — Tab Now Completes Function and Variable
Names
You can now use tab completion in the Editor/Debugger to complete function
names and variable names that are in the current workspace. When you type
the first few characters of a function or variable name and press the Tab key,
the Editor/Debugger displays a list of all function and variable names that
begin with those letters, from which you choose one.
It operates essentially the same way as the existing tab completion feature
in the Command Window, with the exception that Editor/Debugger tab
completion does not support completion of file and path names.
To enable tab completion in the Editor/Debugger, select File > Preferences
> Keyboard, and then under Tab completion, select Tab key narrows
completions. By default, the preference is selected.
399
Version 7.2 (R2006a) MATLAB® Software
With tab completion enabled in the Editor/Debugger, you can still include tab
spacing, for example, to include a comment at the end of a line. To add tab
spacing, include a space after the last character you type and then press
Tab. Instead of showing possible completions, the Editor/Debugger moves the
cursor to the right where you can continue typing.
Compatibility Considerations. If you press the Tab key to add spacing
within your statements, you might instead get a completion for a function
or see a list of possible completions. For example, if the preference for tab
completion is on and you want to create this statement
if a=mate
%test input value
where you press Tab after mate to achieve the spacing, the following happens
instead
if a=material
This is because the tab completion preference completes mate, automatically
supplying the material function.
To achieve the spacing with Tab (as in previous versions), either add a space
after mate and then press Tab, or turn off the preference Tab key narrows
completions in Keyboard Preferences.
Go Menu Added; Bookmark and Go To Items Moved from Edit
Menu to Go Menu
• To set, clear, and navigate to bookmarks, use the menu items in the new
Go menu, which were previously located in the Edit menu.
• The Go To feature for navigating to line numbers, functions in M-files,
and cells has moved to the new Go menu. It was previously located in
the Edit menu.
Compatibility Considerations. Use the new Go menu items instead of
Edit > Bookmark features and Edit > Go To.
400
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
Navigate Back and Forward in Files
Use Go > Back (and Go > Forward) to go to lines you previously edited or
navigated to in a file, in the sequence you accessed them. The main benefit of
this feature is going directly to lines of interest. As an alternative to the menu
items, use the Back and Forward buttons on the toolbar.
Keyboard and Indenting Editor/Debugger Preferences
Reorganized
The Editor/Debugger Keyboard and Indenting preferences pane was
renamed to Tab preferences, and keybinding and parentheses-matching
preferences were moved to the new Keyboard preferences pane. The
parentheses-matching preferences are now called delimiter-matching
preferences and are shared with the Command Window.
M-Lint Automatic Code Analyzer Checks for Problems and
Suggests Improvements
The M-Lint code analyzer, now built into the Editor/Debugger, continuously
checks your code for problems and recommends modifications to maximize
performance and maintainability. It performs the same analysis as the
existing M-Lint Code Check report, but also provides these features:
• Indicates the problem lines and associated M-Lint messages directly in the
M-file rather than in a separate report.
• Identifies (underlines) code fragments within a line that result in M-Lint
messages.
• Distinguishes messages that report errors (red) from warnings and
suggestions (orange).
• Continually analyzes and updates messages as your work so you can see
the effect of your changes without having to save the M-file or rerun an
M-Lint report.
401
Version 7.2 (R2006a) MATLAB® Software
To use or turn off M-Lint in the Editor/Debugger, select
File > Preferences > Editor/Debugger > Language, and for
Language, select M. Under Syntax, select Enable M-Lint messages, or
clear the check box to turn it off. Use the associated drop-down list to specify
the types of code fragments that you want M-Lint to underline, for example,
Underline warnings and errors.
Debugging Changes
• The dbstop function now allows you to stop at, (not in), a non M-file,
allowing you to view code and variables near it in your M-file. For example,
if you want to stop at the point in your M-file myfile.m where the built-in
clear function is called, run dbstop in clear; mymfile. Use this feature
with caution because the debugger stops in M-files it uses for running and
debugging if they contain the non M-file, and then some debugging features
do not operate as expected, such as typing help functionname at the K>>
prompt.
402
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
Cell Mode On by Default — Shows Cell Toolbar and Possibly
Horizontal Lines and Yellow Highlighting; Cell Information Bar
and Button Added
Cell mode, a useful feature in the Editor/Debugger for publishing results
and rapid code iteration, is now enabled by default. An M-file cell is denoted
by a %% at the start of a line. Any M-file that contains %% at the start of a
line is interpreted as including cells. The Editor/Debugger reflects the cell
toolbar state and the cell display preferences, such as yellow highlighting of
the current cell and gray horizontal lines between cells.
For quick access to information about using cells in M-files, use the new
information
button on the cell toolbar.
403
Version 7.2 (R2006a) MATLAB® Software
404
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
If you do not want cell mode enabled, select Cell > Disable Cell Mode.
MATLAB remembers the cell mode between sessions. If cell mode is disabled
when you quit MATLAB, it will be disabled the next time you start MATLAB,
and the converse is true.
In MATLAB Version 7.2, the first time you open an M-file in the
Editor/Debugger, the cell toolbar appears. If the M-file contains a line
beginning with %%, an information bar appears below the cell toolbar,
providing links for details about cell mode. To dismiss the information bar,
click the close box on the right side of the bar. To hide the cell toolbar,
right-click the toolbar and select Cell Toolbar from the context menu.
Compatibility Considerations. In previous versions, cell mode was off by
default. The cell toolbar and yellow highlighting or horizontal rules in M-files
that contain %% at the start of a line might be unexpected. If you used the %%
symbols at the start of a line in M-files for a purpose other than denoting
M-file cells, consider replacing the %% symbols with a different indicator, or
keep cell mode disabled.
Lines Between Cells
You can set an Editor/Debugger display preference, Show lines between
cells, to add a faint gray rule above each cell in an M-file. The line does not
print or appear in the published M-file.
Cell Titles in Bold Preference Removed
Previous versions included an Editor/Debugger display preference to Show
bold cell titles. When cleared, cell titles appeared in plain text, rather than
bold text. This is no longer a preference you can set — all cell titles now
appear in bold text.
405
Version 7.2 (R2006a) MATLAB® Software
Tuning and Managing M-Files
New features and changes introduced in Version 7.2 (R2006a) are
• “M-Lint and mlint Enhancements and Changes” on page 406
• “Profiling Enhancements” on page 407
• “Visual Directory View Removed from Current Directory Browser” on page
407
M-Lint and mlint Enhancements and Changes
The M-Lint code analyzer is now built into the Editor/Debugger where it
continuously checks your code for problems and recommends modifications
to maximize performance and maintainability. For details, see “M-Lint
Automatic Code Analyzer Checks for Problems and Suggests Improvements”
on page 401.
Compatibility Considerations. The mlint function has changed slightly to
support its use in the Editor/Debugger. Specifically, the results returned from
mlint with the -id option are of a different form than for previous versions. If
you rely on the exact values, you need to make modifications.
For example, this is the form of a message returned in R2006a: L 22 (C
1-9) 2:AssignmentNotUsed : The value assigned here to variable
'nothandle' might never be used.
This is the form of the message from R14SP3: 22 (C 1-9)
InefficientUsage:AssignmentNotUsed : The value assigned here to
variable 'nothandle' might never be used.
There is now a numeric identifier, followed by the category, for example:
2:AssignmentNotUsed
If you do rely on the exact values, note that there have been very few changes
to the message text itself. For example, both R14SP3 and R2006a use the
same text: The value assigned here to variable 'nothandle' might
never be used.
Because of improvements being made to mlint, the values returned using the
-id option are expected to change in the next version as well, particularly
406
Desktop Tools and Development Environment, MATLAB® Version 7.2 (R2006a)
the numeric identifier and category form. Do not rely on the exact values
returned using mlint with the -id option or you will probably need to make
modifications.
Profiling Enhancements
nohistory Option Added to profile Function. Use the new profile
-nohistory option after having previously set the -history option to disable
further recording of history (exact sequence of function calls). All other
profiling statistics continue to accumulate.
Accuracy Improved. The Profiler provides more accurate accounting.
The total time you see with the Profiler GUI now matches total wall clock
time from when you started profiling until you stopped profiling. Overhead
associated with the Profiler itself is now applied evenly.
Statistics for Recursive Functions. The profile function now gathers
and reports time for recursive functions in the FunctionTable’s TotalTime
for the function. In previous versions, profile attempted to break out
TotalRecursiveTime, which was not always accounted for accurately. The
value for TotalRecursiveTime in FunctionTable is no longer used.
This change is also reflected in the Profiler GUI reports.
PartialData Reported in Results, AcceleratorMessages Removed. The
FunctionTable now includes the PartialData value. A value of 1 indicates
the function was modified during profiling, for example, by being edited or
cleared, so data was only collected up until the point it was modified.
In previous versions, FunctionTable included AcceleratorMessages
although it was not used. AcceleratorMessages is no longer included.
Visual Directory View Removed from Current Directory
Browser
The Visual Directory view was removed from the Current Directory browser.
Compatibility Considerations. Most of the features it provided are
accessible from the Current Directory browser standard view.
407
Version 7.2 (R2006a) MATLAB® Software
Publishing Results
New features and changes introduced in Version 7.2 (R2006a) are described
here.
Insert Italic Text Markup
You can now make designated text comments in cells appear italicized in the
published output. Use Cell > Insert Text Markup > Italic Text, or use the
equivalent markup symbols, underscores, as in _SAMPLE ITALIC TEXT_.
publish Function has New catchError Option
The publish function has a new catchError option that allows you to
continue or stop publishing if the M-file contains an error.
Source Control Interface
New features and changes introduced in Version 7.2 (R2006a) are described
here.
PVCS Source Control System Name Change
The PVCS® source control system (from Merant) now has a new name,
ChangeMan® (from Serena®), and the source control interface in MATLAB on
UNIX platforms reflects this change.
If you use the ChangeMan software on UNIX platforms, the cmopts value
returned for it is pvcs. If you use PVCS software, select ChangeMan in the
Source Control Preferences pane.
Compatibility Considerations. PVCS software users on UNIX platforms
formerly selected PVCS in the Source Control Preferences pane. Now, PVCS
software users select ChangeMan instead.
408
Mathematics, MATLAB Version 7.2 (R2006a)
Mathematics, MATLAB Version 7.2 (R2006a)
New features and changes introduced in this version are
• “New Library CHOLMOD for Sparse Cholesky Factorization” on page 409
• “New Solver for State-Dependent DDEs” on page 409
• “Upgrade to BLAS Libraries” on page 409
• “New Function for Integer Division” on page 410
• “New Input to gallery Function” on page 410
• “Improved Algorithm for expm” on page 410
• “More Efficient condest for Sparse Matrices” on page 410
• “accumarray Accepts Cell Vector Input” on page 410
New Library CHOLMOD for Sparse Cholesky
Factorization
For sparse matrices, MATLAB now uses CHOLMOD version 1.0 to compute
the Cholesky factor. CHOLMOD is a set of routines offering improved
performance in factorizing sparse symmetric positive definite matrices. See
the function reference pages for chol, spparms, and mldivide for more
information on how CHOLMOD is used by MATLAB.
New Solver for State-Dependent DDEs
In this release, MATLAB provides a second solver function, ddesd, in addition
to the existing dde23 function, for delay differential equations (DDEs). This
new solver is for use on equations that have general delays. You supply a
function in the input argument list that returns the vector of delays to be
used by the solver. See the function reference page for ddesd, and “Delay
Differential Equations” in the MATLAB Mathematics documentation for
more information.
Upgrade to BLAS Libraries
MATLAB now uses new versions of the Basic Linear Algebra Subroutine
(BLAS) libraries. For Intel processors on Windows and Linux platforms,
409
Version 7.2 (R2006a) MATLAB® Software
MATLAB supports the Math Kernel Library (MKL) version 8.0.1. For AMD
processors on Linux platforms, MATLAB uses the AMD Core Math Library
(ACML) version 2.7.
New Function for Integer Division
The new idivide function provides division similar to A./B on integers except
that fractional quotients are rounded to integers according to a specified
rounding mode.
New Input to gallery Function
The gallery function has a new, optional input argument called classname.
The classname input is a quoted string that must be either 'single' or
'double'. When you specify a classname argument in the call to gallery,
MATLAB produces a matrix of that class.
Improved Algorithm for expm
The expm function now uses an improved algorithm to compute a matrix
exponential. This algorithm often requires fewer matrix multiplications.
More Efficient condest for Sparse Matrices
The condest function handles sparse matrices more efficiently when
estimating a 1-norm condition number.
accumarray Accepts Cell Vector Input
The accumarray function now accepts a cell vector as the subs input. This
vector can have one or more elements, each element a vector of positive
integers. All the vectors must have the same length. In this case, subs is
treated as if the vectors formed columns of an index matrix.
410
Data Analysis, MATLAB® Version 7.2 (R2006a)
Data Analysis, MATLAB Version 7.2 (R2006a)
New features and changes introduced in this version are
• “Data Analysis Collection Revised and Expanded” on page 411
• “Reference Pages for timeseries and tscollection Objects” on page 411
• “Text Files Can Be Imported In Time Series Tools” on page 411
• “Linux 64 Platform Fully Enabled for Time Series Tools” on page 411
Data Analysis Collection Revised and Expanded
In this release, the MATLAB Data Analysis collection has been thoroughly
revised to improve content organization and flow. In addition, most examples
have been updated and streamlined.
Reference Pages for timeseries and tscollection
Objects
Detailed reference pages are now available for timeseries and tscollection
objects, properties, and methods. You can access these reference pages in the
Help contents, under “Data Analysis” in the MATLAB Function Reference.
Text Files Can Be Imported In Time Series Tools
In Time Series Tools, you can now use the Import Wizard to import data from
text files, such as .csv, .dat, and .txt.
Linux 64 Platform Fully Enabled for Time Series Tools
Time Series Tools is now fully enabled on the Linux 64 platform.
Compatibility Considerations
On the Linux 64 platform, you no longer need to manually enable the Time
Series Tools feature before starting Time Series Tools (as in MATLAB 7.1).
411
Version 7.2 (R2006a) MATLAB® Software
Programming, MATLAB Version 7.2 (R2006a)
New features and changes introduced in this version are
• “Larger Data Sets with 64-Bit Windows XP” on page 412
• “Using avifile and movie2avi on Windows XP 64” on page 412
• “Regular Expressions” on page 413
• “Setting Environment Variables” on page 414
• “issorted Support for Cell Arrays” on page 414
• “XLS Functions Support More Formats” on page 414
• “Archiving Functions Accept Files on Path and ~/” on page 415
• “sendmail No Longer Requires ASCII Messages” on page 415
• “MATLAB Warns on Invalid Input to str2func” on page 415
• “Changes to Character Encoding in File I/O” on page 415
Larger Data Sets with 64-Bit Windows XP
MATLAB support for Windows XP 64-bit edition enables you to handle
much larger data sets. To learn more about how this affects the amount
of workspace available, maximum matrix size, and maximum number of
elements you can have in an array, see Technical Note 1110: “ Maximum
Matrix Size by Platform” at the following URL:
http://www.mathworks.com/support/tech-notes/1100/1110.html
Using avifile and movie2avi on Windows XP 64
Note You must change the compression setting if you use the avifile or
movie2avi function on Windows XP 64.
MATLAB currently defaults to using Indeo codecs to compress video frames
when using avifile/addframe or movie2avi. If you attempt to use avifile
and addframe, or movie2avi on a Windows XP 64-bit platform without
412
Programming, MATLAB Version 7.2 (R2006a)
specifying the compression type, an error message appears indicating the
codec was not found. Nondefault settings must be explicitly passed in when
using these functions on Windows XP 64 because Microsoft does not provide
Indeo codecs on this platform.
This issue does not affect 32-bit Windows XP installations.
Compatibility Considerations
To work around this issue, do the following:
1 Explicitly specify no compression when creating the avifile object or when
calling movie2avi. Two examples of this are
aviobj = avifile('myvideo.avi', 'compression', 'none');
movie2avi(mov, 'myvideo.avi', 'compression', 'none');
2 Specify a codec for a compression that is installed. The ones that are
included with Windows XP 64 are
• IYUV — Intel YUV codec (c:\winnt\system32\iyuv_32.dll)
• MRLE — Microsoft RLE codec (c:\winnt\system32\msrle32.dll)
• MSVC — Microsoft Video 1 codec (c:\winnt\system32\msvidc32.dll)
For example, to use the Intel YUV codec, use the four-CC code:
aviobj = avifile('myvideo.avi', 'compression', 'IYUV');
Other codecs can be found at http://fourcc.org.
Note there are restrictions with some codecs. For example, some codecs can
only be used with grayscale images.
Regular Expressions
MATLAB 7.2 introduces the following new features for regular expressions in
MATLAB. For more information on these features, see “Regular Expressions”
in the MATLAB Programming documentation.
413
Version 7.2 (R2006a) MATLAB® Software
New Features
• Dynamic regular expressions — You can now insert MATLAB expressions
or commands into regular expressions or replacement strings. The dynamic
part of the expression is then evaluated at runtime.
• Generating literals in expressions — Use the new regexptranslate
function when you want any of the MATLAB regular expression functions
to interpret a string containing metacharacters or wildcard characters
literally.
• New parsing modes — Four matching modes (case-sensitive, single-line,
multiline, and freespacing) extend the parsing capabilities of the MATLAB
regular expression functions.
• Warnings display — Use the new 'warnings' option with the regular
expression functions to enable the display of warnings that are otherwise
hidden.
Compatibility Considerations
Calling regexp or regexpi with the 'tokenExtents' and 'once' options
specified now returns a double array instead of a cell array. You may need to
change your code to accommodate the new return type.
Setting Environment Variables
Use the new setenv function to set the value of an environment variable
belonging to the underlying operating system.
issorted Support for Cell Arrays
You can now use the issorted function on a cell array of strings.
XLS Functions Support More Formats
xlsread now supports Excel files having formats other than XLS (e.g., HTML)
as long as the COM server is available. Also, xlsfinfo now returns this
file format information.
414
Programming, MATLAB Version 7.2 (R2006a)
Archiving Functions Accept Files on Path and ~/
Files specified as arguments to gzip, gunzip, tar, and zip can now be
specified as partial path names. On UNIX machines, directories can start
with ~/ or ~username/, which expands to the current user’s home directory or
the specified user’s home directory, respectively. The wildcard character *
can be used when specifying files or directories, except when relying on the
MATLAB path to resolve a filename or partial pathname.
sendmail No Longer Requires ASCII Messages
E-mail messages that you send using sendmail are no longer restricted to
ASCII character encoding schemes.
MATLAB Warns on Invalid Input to str2func
Due to a bug introduced in MATLAB R14, the str2func function failed
to issue a warning or error when called with an invalid function name or
a function name that includes a path specification. In the R2006a release,
str2func now generates a warning under these conditions. In a future
version of MATLAB, str2func will generate an error under these conditions.
Compatibility Considerations
Any existing code that calls str2func with an invalid function name or a
function name that includes the path now generates a warning message from
MATLAB. In a future version, this will cause an error. You should note any
such warnings when using R2006a, and fix the input strings to str2func so
that they specify a valid function name.
Changes to Character Encoding in File I/O
The fopen function has a new optional argument, a string that specifies a
name or alias for the character encoding scheme associated with the file. If
this argument is omitted or is the empty string (’’), the MATLAB default
encoding scheme is used. Given a file identifier as the only argument, fopen
now returns an additional output value, a string that identifies the character
encoding scheme associated with the file.
Low-level file I/O functions that read data from files, including fread, fscanf,
fgetl, and fgets, read characters using the encoding scheme associated with
415
Version 7.2 (R2006a) MATLAB® Software
the file during the call to fopen. Low-level file I/O functions that write data,
including fwrite and fprintf, write characters using the encoding scheme
associated with the file during the call to fopen.
Support for character encoding schemes has these limitations:
• Surrogate pairs are not supported. Each surrogate pair is read as a
replacement character, the equivalent of char(26).
• Stateful character encoding schemes are not supported.
• Byte order marks are not interpreted in any special way. Your code must
skip them if necessary.
• Scanning numbers, using fscanf, is supported only for character encoding
schemes that are supersets of ASCII. (Most popular character encoding
schemes, with the exception of UTF-16, are such supersets.)
Compatibility Considerations
In V7.1 (R14SP3), low-level file I/O functions that read and write data treated
characters as unsigned bytes. Programs using such functions as fread may
have called native2unicode to convert input to MATLAB characters using a
particular encoding scheme. Programs using such functions as fwrite may
have called unicode2native to convert output from MATLAB characters
using a particular encoding scheme.
For example, on a Japanese Windows platform, where the default character
encoding scheme is Shift-JIS, a program may have used native2unicode and
unicode2native to read and write Japanese text in this way:
fid = fopen(file);
data = fread(fid, '*char')';
fclose(fid);
dataU = native2unicode(data);
% operate on data
outData = unicode2native(dataU);
fid = fopen(file, 'w');
fwrite(fid, outData, 'char');
fclose(fid);
416
Programming, MATLAB Version 7.2 (R2006a)
Such a program would produce different and possibly incorrect results in V7.2
(R2006a). The calls to native2unicode and unicode2native are no longer
necessary, because the fread and fwrite functions now convert data to and
from MATLAB characters using the character encoding scheme specified in
the calls to fopen. In V7.2 (R2006a), the example code can be simplified to
produce correct results:
fid = fopen(file);
dataU = fread(fid, '*char')';
fclose(fid);
% operate on data
fid = fopen(file, 'w');
fwrite(fid, dataU, 'char');
fclose(fid);
Changes to code using fread, fgets, fgetl, and fscanf. If your code calls
native2unicode to convert input to MATLAB characters using a specified
(or default) encoding scheme, you can, but do not have to, remove the calls to
native2unicode.
This applies to reading from an encoded file using any of the following:
• fread with precision set to '*char' or 'char=>char'
• fgets or fgetl
• fscanf with the format specifier set to either '%s' or '%c'
When you remove a call to native2unicode, be sure that the call to fopen
supplies the same encoding argument (if any) as the call to native2unicode.
You may have used code like these examples in V7.1 (R14SP3):
indata
indata
indata
indata
indata
indata
=
=
=
=
=
=
native2unicode(fread(fid, '*char')');
native2unicode(fread(fid, 'char=>char')');
native2unicode(fgets(fid));
native2unicode(fgetl(fid));
native2unicode(fscanf(fid, '%s'));
native2unicode(fscanf(fid, '%c'));
You can, but do not have to, remove the calls to native2unicode in V7.2
(R2006a):
417
Version 7.2 (R2006a) MATLAB® Software
indata
indata
indata
indata
indata
indata
=
=
=
=
=
=
fread(fid, '*char')';
fread(fid, 'char=>char')';
fgets(fid);
fgetl(fid);
fscanf(fid, '%s');
fscanf(fid, '%c');
Changes to code using fwrite. If your code calls unicode2native to
convert output from MATLAB characters using a specified (or default)
encoding scheme, in most cases you must remove the calls to unicode2native.
This is especially important if the encoding represents multibyte characters.
This applies to writing an encoded file using fwrite with precision set to
either 'char' or 'char*1'.
When you remove a call to unicode2native, be sure that the call to fopen
supplies the same encoding argument (if any) as the call to unicode2native.
You may have used code like these examples in V7.1 (R14SP3):
fwrite(fid, unicode2native(outbuff), 'char');
fwrite(fid, unicode2native(outbuff), 'char*1');
You must remove the calls to unicode2native in V7.2 (R2006a):
fwrite(fid, outbuff, 'char');
fwrite(fid, outbuff, 'char*1');
418
Graphics and 3-D Visualization, MATLAB® Version 7.2 (R2006a)
Graphics and 3-D Visualization, MATLAB Version 7.2
(R2006a)
Two changes have been introduced in this version:
Pasting Cut or Copied Graphic Objects Can Create
an Axes
The way in which MATLAB handles copying (or cutting) and pasting children
of axes such as lineseries, barseries, or contourgroup objects has changed
slightly. In previous releases, if no destination axes was selected prior to
pasting one or more such objects, they would be pasted into the current axes
(returned by the gca function). MATLAB no longer makes this assumption; if
no axes is currently selected when you paste graphic objects, a new axes is
created in the destination figure to contain them.
To avoid creating a new axes where you do not want to do so, you should
be in plot edit mode and have selected a destination axes before using Edit
-> Paste or typing CTRL-V. You can use the Plot Browser to conveniently
select objects to copy and to paste into.
Inspector Has New Look
The Property Inspector (the GUI summoned by the MATLAB inspect
command) has a new look, but no changed functionality. The inspector
enables you to view and change the most commonly used object properties.
The figure below compares the previous version (7.1, left) of the Property
Inspector with the new version (7.2, right):
419
Version 7.2 (R2006a) MATLAB® Software
Note that in addition to having a smaller font and wider line spacing, the new
inspector locates pop-up menus at the right margin instead of between the
two columns. Also, some icons have been redesigned.
420
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.2 (R2006a)
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.2 (R2006a)
New features and changes introduced in this version are:
• “Treatment of & in Menu Label Is Changed” on page 421
• “Major Documentation Revision” on page 421
Treatment of & in Menu Label Is Changed
The use of '&' (ampersand) in the uimenu 'Label' property string is changed
for cases that use the constructs 'A& B' and 'A&&B'. The changes bring these
constructs in line with the way '&' is used in other 'Label' constructs. See
“Compatibility Considerations” below for specific information.
Compatibility Considerations
Interpretation of 'Label' property strings that use the following constructs
is changed:
• The string 'A& B' now produces the menu label A& B with no underlined
mnemonic. Previously, 'A& B' produced the label A_B, in which the space
is a mnemonic.
• The string 'A&&B' now produces the menu label A & B with no underlined
mnemonic. Previously, 'A&&B' produced the label A&B with no mnemonic.
If you use either construct, 'A& B' or 'A&&B', in your menu labels, verify
that the new resulting label is acceptable or change the 'Label' property
to a new string.
Major Documentation Revision
The MATLAB document Creating Graphical User Interfaces is reorganized
and rewritten. It now consists of three sections:
• Getting Started—Leads you through the steps needed to create a simple
GUI, both programmatically and using GUIDE.
421
Version 7.2 (R2006a) MATLAB® Software
• Creating GUIs with GUIDE—Contains the information, previously
included in Creating Graphical User Interfaces, that you need to create a
GUI using GUIDE. This section is organized in workflow order with many
small examples of the various steps. A final chapter provides advanced
examples.
• Creating GUIs Programmatically—For now, this section contains a
summary of the available functions and complete code examples for three
GUIs.
One GUI uses a variety of user interface controls to enable a user to
calculate the mass of an object after specifying the object’s density and
volume.
Two other GUIs work together as an icon editor. One GUI, a color palette,
is embedded in the other GUI, an icon editor. The color palette passes data
to the icon editor whenever the GUI user selects a new color.
Note Following the release of MATLAB version 7.2, Creating Graphical
User Interfaces will be further updated and expanded. The PDF and HTML
versions of this document will be updated on The MathWorks Web site some
time after the release. Check the top page of the HTML document and the
title page of the PDF to determine if they have been updated.
422
External Interfaces/API, MATLAB® Version 7.2 (R2006a)
External Interfaces/API, MATLAB Version 7.2 (R2006a)
• “MEX-Files Built with gcc on Linux Must Be Rebuilt” on page 423
• “MEX-Files in MATLAB for Microsoft Windows x64” on page 424
• “New Microsoft and Intel Compilers Supported” on page 424
• “MWPOINTER Macro for Platform-Independent Fortran Code” on page 425
• “Compaq Visual Fortran Engine and MAT Options File Renamed” on page
425
• “Options Files Removed for Unsupported Compilers” on page 425
• “Obsolete Functions No Longer Documented” on page 426
• “Support for Licensed ActiveX Controls” on page 430
• “Support for VT_Date Type” on page 431
• “Dynamic Linking of External Libraries” on page 431
MEX-Files Built with gcc on Linux Must Be Rebuilt
In MATLAB V7.2 (R2006a) on Linux and Linux x86-64 platforms, MEX-files
built with gcc must be recompiled and relinked using gcc version 3.4 or later.
Rebuilding is required because MATLAB V7.2 (R2006a) on Linux and Linux
x86-64 platforms is built with gcc version 3.4.
Compatibility Considerations
Changes in gcc version 3.4 have caused incompatibilities between MATLAB
V7.2 (R2006a) and MEX-files built with gcc versions earlier than 3.4.
On Linux and Linux x86-64 platforms, MEX-files built with gcc versions
earlier than 3.4 cannot be used in MATLAB V7.2 (R2006a).
On Linux and Linux x86-64 platforms, MEX-files built with gcc version 3.4 or
later cannot be used in versions of MATLAB earlier than V7.2 (R2006a).
423
Version 7.2 (R2006a) MATLAB® Software
MEX-Files in MATLAB for Microsoft Windows x64
With the introduction of MATLAB for Windows x64, you can now build
64-bit MEX-files. These MEX-files have the extension .mexw64. The mexext
command returns mexw64 in MATLAB for Windows x64.
Compatibility Considerations
MEX-files built using MATLAB for Windows (32-bit), which have.mexw32
extensions by default, cannot be used in MATLAB for Windows x64.
By default, when MATLAB for Windows x64 is installed, the mex.pl and
mex.bat scripts build MEX-files for a Windows x64 platform (with .mexw64
extensions).
New Microsoft and Intel Compilers Supported
MATLAB V7.2 (R2006a) supports new compilers for building MEX-files on
Windows and Windows x64 platforms:
• Microsoft Visual C++ 2005, also informally called Visual C++ 8.0, part of
Microsoft Visual Studio 2005
• Intel Visual Fortran 9.0
Environment Variables Needed for Intel Visual Fortran
When you build a MEX-file or an Engine or MAT application using Intel
Visual Fortran 9.0, MATLAB requires an environment variable to be defined,
depending on whether you are building in MATLAB for Windows (32-bit) or
MATLAB for Windows x64:
• MATLAB for Windows (32-bit): The environment variable VS71COMNTOOLS
must be defined. The value of this environment variable is the path to
the Common7\Tools directory of the Visual Studio .NET 2002 or 2003
installation directory. (Intel Visual Fortran requires Visual Studio .NET
2002 or 2003 on 32-bit Windows platforms.) This environment variable is
commonly defined by the Visual Studio .NET 2003 installation program.
• MATLAB for Windows x64: The environment variable MSSdk must
be defined. The value of this environment variable is the path to the
installation directory for Microsoft Platform SDK for Windows Server
424
External Interfaces/API, MATLAB® Version 7.2 (R2006a)
2003. (Intel Visual Fortran requires Microsoft Platform SDK for Windows
Server 2003 on Windows x64 platforms.) This environment variable is not
commonly defined by the Microsoft Platform SDK installation program.
MWPOINTER Macro for Platform-Independent
Fortran Code
MATLAB provides a preprocessor macro, mwPointer , that declares the
appropriate Fortran type representing a pointer to an mxArray or to other
data that is not of a native Fortran type, such as memory allocated by
mxMalloc. On 32-bit platforms, the Fortran type that represents a pointer is
INTEGER*4; on 64-bit platforms, it is INTEGER*8. The Fortran preprocessor
translates MWPOINTER to the Fortran declaration that is appropriate for the
platform on which you compile your file.
Compaq Visual Fortran Engine and MAT Options File
Renamed
MATLAB V7.1 (R14SP3) included a Windows Engine and MAT options file
named df66engmatopts.bat. This file contained options for Compaq Visual
Fortran version 6.6 for use in building Fortran engine or MAT stand-alone
programs. The file name df66engmatopts.bat originated with an earlier
version of the Fortran compiler, named Digital Fortran.
In V7.2 (R2006a), this file has been renamed cvf66engmatopts.bat to match
the Compaq Visual Fortran product name.
Compatibility Considerations
You may need to change any scripts that depend on the earlier name for
the options file.
Options Files Removed for Unsupported Compilers
MATLAB V7.1 (R14SP3) included MEX, Engine, and MAT options files for
a number of Windows C and Fortran compilers that were untested. These
options files are not included in V7.2 (R2006a). The unsupported compilers,
and the supported compilers that replace them, are:
425
Version 7.2 (R2006a) MATLAB® Software
Unsupported Compiler
Supported Replacement
Borland 5.0, 5.2, 5.3, 5.4
Borland 5.5, Borland 5.5 Free,
Borland 5.6
Digital Visual Fortran 5.0, 6.0
Compaq Visual Fortran 6.1, Compaq
Visual Fortran 6.6, Intel Visual
Fortran 9.0
Microsoft Visual C++ 5.0, Visual
C++ .NET 2002 (7.0)
Microsoft Visual C++ 6.0, Visual
C++ .NET 2003 (7.1), Visual C++
2005 (8.0)
Watcom 10.6, 11
Open Watcom 1.3
Compatibility Considerations
If you were using an untested compiler with a previous version of MATLAB,
replace it with a supported compiler. You may need to recompile your
MEX-files or applications.
Obsolete Functions No Longer Documented
In V7.1 (R14SP3), many MAT-file access, MX array manipulation, MEX-files,
and MATLAB engine functions were declared obsolete in the External
Interfaces Reference documentation. These functions are no longer
documented in V7.2 (R2006a).
This section lists the obsolete functions removed from the documentation,
along with replacement functions, if any.
Obsolete Functions: MAT-File Access
426
Obsolete Function
Replacement
matDeleteArray (C and
Fortran)
matDeleteVariable
matDeleteMatrix (C
and Fortran)
matDeleteVariable
External Interfaces/API, MATLAB® Version 7.2 (R2006a)
Obsolete Function
Replacement
matGetArray (C and
Fortran)
matGetVariable
matGetArrayHeader (C
and Fortran)
matGetVariableInfo
matGetFull (C and
Fortran)
matGetVariable followed by mxGetM, mxGetN,
mxGetPr, mxGetPi
matGetMatrix (C and
Fortran)
matGetVariable
matGetNextArray (C
and Fortran)
matGetNextVariable
matGetNextArrayHeader
(C and Fortran)
matGetNextVariableInfo
matGetNextMatrix (C
and Fortran)
matGetNextVariable
matGetString (C and
Fortran)
matGetVariable followed by mxGetString
matPutArray (C and
Fortran)
matPutVariable
matPutArrayAsGlobal
(C and Fortran)
matPutVariableAsGlobal
matPutFull (C and
Fortran)
mxCreateDoubleMatrix followed by mxSetPr,
mxSetPi, matPutVariable
matPutMatrix (C and
Fortran)
matPutVariable
matPutString (C and
Fortran)
mxCreateString followed by matPutVariable
427
Version 7.2 (R2006a) MATLAB® Software
Obsolete Functions: MX Array Manipulation
Obsolete Function
Replacement
mxClearLogical (C and
Fortran)
None
mxCreateFull (C and
Fortran)
mxCreateDoubleMatrix
mxCreateScalarDouble
(C and Fortran)
mxCreateDoubleScalar
mxFreeMatrix (C and
Fortran)
mxDestroyArray
mxGetName (C and
Fortran)
None
mxIsFull (C and
Fortran)
mxIsSparse
mxIsString (C and
Fortran)
mxIsChar
mxSetLogical (C and
Fortran)
None
mxSetName (C and
Fortran)
None
Obsolete Functions: MEX-Files
428
Obsolete Function
Replacement
mexAddFlops (C)
None
mexGetArray (C and
Fortran)
mexGetVariable
mexGetArrayPtr (C and
Fortran)
mexGetVariablePtr
mexGetEps (C and
Fortran)
mxGetEps
External Interfaces/API, MATLAB® Version 7.2 (R2006a)
Obsolete Function
Replacement
mexGetFull (C and
Fortran)
mexGetVariable followed by mxGetM, mxGetN,
mxGetPr, mxGetPi
mexGetGlobal (C and
Fortran)
mexGetVariablePtr
mexGetInf (C and
Fortran)
mxGetInf
mexGetMatrix (C and
Fortran)
mexGetVariable
mexGetMatrixPtr (C and
Fortran)
mexGetVariablePtr
mexGetNaN (C and
Fortran)
mxGetNaN
mexIsFinite (C and
Fortran)
mxIsFinite
mexIsInf (C and
Fortran)
mxIsInf
mexIsNaN (C and
Fortran)
mxIsNaN
mexPutArray (C and
Fortran)
mexPutVariable
mexPutFull (C and
Fortran)
mxCreateDoubleMatrix followed by mxSetPr,
mxSetPi, mexPutVariable
mexPutMatrix (C and
Fortran)
mexPutVariable
Obsolete Functions: MATLAB Engine
Obsolete Function
Replacement
engGetArray (C and
Fortran)
engGetVariable
engGetFull (C and
Fortran)
engGetVariable followed by mxGetM, mxGetN,
mxGetPr, mxGetPi
429
Version 7.2 (R2006a) MATLAB® Software
Obsolete Function
Replacement
engGetMatrix (C and
Fortran)
engGetVariable
engPutArray (C and
Fortran)
engPutVariable
engPutFull (C and
Fortran)
mxCreateDoubleMatrix followed by mxSetPr,
mxSetPi, engPutVariable
engPutMatrix (C and
Fortran)
engPutVariable
engSetEvalCallback (C)
None
engSetEvalTimeout (C)
None
engWinInit (C)
None
Compatibility Considerations
Most of the functions listed as obsolete in this section are unsupported in
V6.5 (R13) and later versions. Some obsolete functions are unsupported in
earlier versions.
If this section lists a replacement for an obsolete function, change any code
that refers to the obsolete function to use the replacement instead.
If you must use an obsolete function in a MEX-file or application, use the -V5
option to mex when you build the file.
Support for Licensed ActiveX Controls
MATLAB supports the use of Microsoft ActiveX controls that require licensing
at both design time and runtime.
See the actxcontrol function for information on how to specify a design-time
license key.
See “Deploying ActiveX Controls Requiring Run-Time Licenses” for
information on how to use ActiveX Controls that require runtime licenses in
your MATLAB application.
430
External Interfaces/API, MATLAB® Version 7.2 (R2006a)
Support for VT_Date Type
MATLAB defines a data type to be used with controls requiring input defined
as type VT_DATE. See “Using Date Data Type” for more information.
Dynamic Linking of External Libraries
MATLAB supports dynamic linking of external libraries only on 32-bit
Windows systems and 32-bit Linux systems. See “MATLAB Interface to
Shared Libraries” for more information.
431
Version 7.1 (R14SP3)
MATLAB Software
This table summarizes what’s new in Version 7.1 (R14SP3):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports at
Web site
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.1
(R14SP3)” on page 435
• “Mathematics, MATLAB Version 7.1 (R14SP3)” on page 449
• “Data Analysis, MATLAB Version 7.1 (R14SP3)” on page 453
• “Programming, MATLAB Version 7.1 (R14SP3)” on page 455
• “Graphics and 3-D Visualization, MATLAB Version 7.1 (R14SP3)” on page
462
433
Version 7.1 (R14SP3) MATLAB® Software
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.1
(R14SP3)” on page 463
• “External Interfaces/API, MATLAB Version 7.1 (R14SP3)” on page 465
434
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
Desktop Tools and Development Environment, MATLAB
Version 7.1 (R14SP3)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 435
• “Desktop” on page 436
• “Running Functions — Command Window and Command History” on page
439
• “Help” on page 440
• “Workspace, Search Path, and File Operations” on page 442
• “Editing and Debugging M-Files” on page 443
• “Tuning and Managing M-Files” on page 446
• “Publishing Results” on page 447
Startup and Shutdown
New features and changes introduced in this version are described here.
Startup Option, –nodesktop, on Windows Platforms No Longer
has Menu Bar and Toolbar; Use Function Equivalents Instead
The behavior of MATLAB software when started on Microsoft Windows
platformswith the -nodesktop option has changed. The MATLAB Command
Window no longer displays a menu bar or toolbar. This change resolves
a number of problems that occurred in previous versions when running
MATLAB in -nodesktop mode on Windows platforms.
Compatibility Considerations. Use equivalent functions instead of the
menu and toolbar.
Instead of using the File > Preferences menu to modify the font or colors
used in the Command Window, run preferences -nodesktop. For more
information, see “preferences Function Now Supports -nodesktop Option”
on page 438.
435
Version 7.1 (R14SP3) MATLAB® Software
Desktop
New features and changes introduced in this version are organized by these
topics:
• “Arranging Windows and Documents” on page 436
• “Preferences Directory Added for R14SP3; Supplements R14 Directory”
on page 437
• “Preferences Changes for Fonts, Hyperlinks, and -nodesktop” on page 438
• “info.xml File Automatic Validation; Shows Warnings for Invalid
Constructs” on page 439
• “Other Desktop Changes” on page 439
Arranging Windows and Documents
Figure Windows Now Dockable on Macintosh Platforms. On Apple
Macintosh platforms, figure windows are now dockable.
Resize Multiple Tools at Once. You can now position the pointer at the
intersection of three or four tools or documents to resize all of them at once.
Resize and Move Desktop Tools Using the Keyboard. There are now
menu items you can select to move and resize the active tool in the desktop.
Use the menu item mnemonics to perform those action with the keyboard.
For example, if the Command Window is in the desktop along with other
tools, press Ctrl+0 (or click in it) to make the Command Window the active
tool. Then press Alt+D, V, which is the mnemonic equivalent for selecting
Desktop > Move Command Window. The pointer becomes an arrow. Use
the arrow keys to move an outline of the Command Window to a new dockable
location. Press Enter to dock it there, or press Esc to return the Command
Window to its original position.
Resize Names in the Document Bar. You can now adjust the width of a
name in the document bar when the bar is at the top or bottom of the window.
436
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
Positioning Document Bar Menu Item Name Changed. In previous
versions, selecting Desktop > Document Bar displayed only menu
items for positioning the document bar. Now, there are additional menu
items. The same change was made to the context menu for the document
bar. To access the menu items for positioning the document bar, select
Desktop > Document Bar > Bar Position.
Keyboard Access Added for Document Bar Options. The
Desktop > Document Bar now includes these items: Alphabetize, Width,
and Move documentname On Bar. With their inclusion in the menu,
you can use the keyboard to access these features via mnemonics. For
example, on Windows platforms, press Alt+D, M, A as a shortcut to for
Desktop > Document Bar > Alphabetize.
Left/Right and Top/Bottom Split for Document Arrangements Name
Changed. When arranging documents in desktop tools, you can choose
Window > Left/Right Split or Window > Top/Bottom Split to show two
documents at once in the tool. Those menu items are now called Left/Right
Tile and Top/Bottom Tile. This change was made to avoid any confusion
with the Editor/Debugger’s new split screen feature.
Preferences Directory Added for R14SP3; Supplements R14
Directory
There is a new preferences directory, R14SP3. This is the directory name
returned when you run the prefdir function. When you install R14SP3,
MATLAB migrates files from your existing preference directory, R14, to the
new directory, R14SP3. Changes made to files in the directory when you run
R14SP3 are not used when you run previous R14 releases.
This represents a change in the preference directory MATLAB uses for a
minor release, and was done to prevent serious backwards compatibility
problems. It is primarily relevant if you use R14SP3 and previous R14
releases. If you only run R14SP3, or run R14SP3 with R13 or R12 releases,
you will not be affected by this change.
In the past, minor releases and the associated major release used the
same preferences directory. For example, R13 and R13SP1 shared the R13
preferences directory. That continues to be true for all previous releases, but
is not true for R14SP3 and beyond. The R14 preferences directory will be
437
Version 7.1 (R14SP3) MATLAB® Software
shared by the R14 through R14SP2 releases, but the new R14SP3 preferences
directory is only used by R14SP3. This means that changes made to files in
the directory while running R14SP3 re not used when you run a previous
R14 releases, and the reverse is true. For example, statements added to the
Command History when you run R14SP3 are not in the Command History
when you run R14SP2.
For more information, see the reference page for prefdir.
Compatibility Considerations. This change was made to prevent major
backwards compatibility problems. Use the R14SP3 preferences directory
instead of the R14 directory. If you use the prefdir function and have code
that relies on the result being R14, you will need to modify that code.
Preferences Changes for Fonts, Hyperlinks, and -nodesktop
Font Antialiasing Preference Added. In Preferences > Fonts, select the
new antialiasing preference to provide a smoother appearance to desktop
fonts.
Hyperlink Color Preference Changed. There is a new Colors preference
for specifying the color of hyperlinks in the Command Window and the Help
browser Index pane. In previous releases, this preference only applied to
the Command Window hyperlinks and was accessed via Command Window
preferences.
preferences Function Now Supports -nodesktop Option. Run
preferences -nodesktop after starting MATLAB on Windows platforms
with the -nodesktop option to change Command Window font and colors via
a special Preferences dialog box.
To set other available preferences for the Command Window after starting
MATLAB with the -nodesktop option, run preferences and use the resulting
Preferences dialog box for all tools and products. Note that changes you
make to font and color preferences in this dialog box do not apply to the
Command Window.
438
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
info.xml File Automatic Validation; Shows Warnings for
Invalid Constructs
If you add your own toolbox to the Start button, you can use the schema file for
its info.xml file, matlabroot/sys/namespace/info/v1/info.xsd. MATLAB
now automatically validates your info.xml file against this schema when you
click the Start button after updating and refreshing your info.xml file.
Compatibility Considerations. If your info.xml contains invalid
constructs, you will see warnings in the Command Window until you correct
the problems.
Other Desktop Changes
Paste Special Menu Item Renamed. In the Edit menu, the name of the
Paste Special item has been replaced by Paste to Workspace, but the
functionality remains the same. It opens the Import Wizard so you can paste
the clipboard contents to the workspace in MATLAB.
Rename Shortcut Categories. You can now rename shortcut categories.
Running Functions — Command Window and
Command History
New features and changes introduced in this version are
• “Tab Completion Preference Added” on page 439
• “Tab Completion No Longer Shows Entries Twice” on page 440
• “Incremental Search Now Supports Removing Characters” on page 440
• “Hyperlink Color Preference Moved” on page 440
Tab Completion Preference Added
There is a new Command Window preference, Tab key narrows
completion. When selected, with a list of possible completions in view, type
another character and press Tab to further narrow the list shown. Repeat
to continue narrowing the list. This behavior is similar to tab completion
behavior in releases prior to R14.
439
Version 7.1 (R14SP3) MATLAB® Software
Tab Completion No Longer Shows Entries Twice
In previous versions, when completing filenames or function names, a name
sometimes appeared twice in the completion list, once with the file extension
and once without. Now the entry appears only once.
Incremental Search Now Supports Removing Characters
In incremental search, use Ctrl+G to remove characters back to the previous
successful string of characters found. For example, when searching for the
term plode, the text is not found and Failing appears in the incremental
search field. Ctrl+G automatically removes the de from the search term
because plo does exist in the file.
Hyperlink Color Preference Moved
The preference for specifying the hyperlink color has moved from the
Command Window preferences pane to the Colors preferences pane. The
hyperlink color now also applies to links in the Help browser Index pane.
Compatibility Considerations. Use the Colors preference pane to specify
the hyperlink color, and be aware that it also impacts the Help browser
Index pane color.
Help
New features and changes introduced in this version are
• “Hyperlink Color in the Index Pane Preference Added” on page 441
• “New Look for Demos, Including Thumbnails and Categories” on page 441
• “Demos Run in Command Window as Scripts and Their Variables Now
Created in Base Workspace” on page 441
• “echodemo Function Added to Replace playshow function” on page 442
• “Add Demos to Favorites” on page 442
• “Adding Your Own Demos Type Tag Now Supported” on page 442
• “Bug Reporting System Introduced” on page 442
440
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
Hyperlink Color in the Index Pane Preference Added
You can now specify the color for links in the Help browser Index pane using
the Colors preferences pane. The hyperlink color also applies to links in the
Command Window, so changes you make to the preference apply to both tools.
New Look for Demos, Including Thumbnails and Categories
Stylistic changes were made to the Demos interface in the Help browser. On
the summary page for a product, each demo appears with a thumbnail image
that provides an indication of the type of output it creates, as well as an icon
representing the type of demo (M-file, M-GUI, model, or video).
Demos Run in Command Window as Scripts and Their
Variables Now Created in Base Workspace
In this release, all M-file demos include the Run in the Command Window
link, which executes the demo via echodemo.
In previous releases, some M-file demos provided a Run hyperlink in the
display pane. When you clicked Run, the M-file demo executed in a GUI via
the playshow function. An example of this type of demo is the MATLAB
Mathematics Basic Matrix Operations demo, intro.m. In this release, the
Run hyperlink for these M-file demos has been replaced by Run in the
Command Window. It executes the demo step by step in the Command
Window via the echodemo function. Double-clicking this type of M-file demo
in the Navigator pane no longer runs the M-file demo, but opens the M-file in
the Editor/Debugger where you can run it step by step using Cell > Evaluate
Current Cell and Advance.
Compatibility Considerations. The new Run in Command Window
hyperlink represent a change in the way demos run.
The echodemo function MATLAB uses to run M-file demos in the Command
Window runs the demos as scripts. The playshow function MATLAB used
to run M-file demos in previous releases ran the demos as a function. This
means that now the demo’s variables are created in the base workspace. If
you have variables in the base workspace when you run an M-file demo, and
the demo uses an identical variable name, there could problems with variable
name conflicts. For example, your variable could be overwritten. The demo’s
variables remain in the base workspace after the demo finishes running until
441
Version 7.1 (R14SP3) MATLAB® Software
you clear them or quit MATLAB. Another change is that figures are not
automatically closed when you end the demo.
echodemo Function Added to Replace playshow function
There is a new echodemo function that replaces playshow. The Demos
browser uses echodemo to execute M-file demos when you click the Run in
the Command Window link.
Compatibility Considerations. The playshow function is deprecated in
favor of the echodemo function. In a future release, the playshow function will
be removed. In practice, both echodemo and playshow are helper functions
for running demos. It is unlikely you would ever call either playshow or
echodemo directly, and especially not in M-files.
Add Demos to Favorites
You now can add published M-file demos to favorites.
Adding Your Own Demos Type Tag Now Supported
If you add demos for your own toolbox, you can use the new <type> tag for a
<demoitem> to identify the type of demo in your toolbox’s demos.xml file.
Bug Reporting System Introduced
You now can view bugs fixed with this release, as well as any known bugs
using the Bug Reports database in the Support section of the MathWorks
Web site. The MathWorks continuously updates the database to add any
newly found bugs and compatibility issues, as well as any new workarounds
and solutions. The system includes bugs found and fixed in R14SP2 and
later releases.
Workspace, Search Path, and File Operations
New features and changes introduced in this version are described here.
Find Files Offers Additional Filtering
The Find Files tool has been enhanced. It now allows you to search all file
types except those specified. It also lets you ignore files larger than a specified
442
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
size. Along with enhancements to the Find Files tool, some minor feature
changes were made, including the removal of the Restore Defaults button.
Visual Directory View to be Removed
In the next release, the Current Directory browser will no longer support the
Visual Directory view (accessed using the
toolbar button).
Compatibility Considerations. Some features currently available using
the Visual Directory view will not be available in the next release when the
feature is removed.
Editing and Debugging M-Files
New features and changes introduced in this version are
• “Split Screen Display Added” on page 443
• “Highlight Current Line Added” on page 444
• “Comment Lines in Java, C, or C++ Program Files Now Supported” on
page 445
• “HTML File Indenting Feature Added as the Default” on page 445
• “Incremental Search Now Supports Removing Characters” on page 446
• “Emacs Key Binding for Select All” on page 446
• “Change Case Added to Menu” on page 446
• “Nested Function Name No Longer in Status Bar” on page 446
Split Screen Display Added
The Editor/Debugger now supports a horizontal or vertical split screen for
displaying two different parts of the same document at once. To split the
screen, select Window > Split Screen and the splitting action you want, for
example, Top/Bottom. Alternatively, drag the splitter bar that appears
above the vertical scroll bar or to the left of the horizontal scroll bar. To
remove the splitter, drag it to an edge of the window.
443
Version 7.1 (R14SP3) MATLAB® Software
Highlight Current Line Added
You can set a preference to highlight the current line, that is, the line with
the caret (also called the blinking cursor). This is useful, for example, to
help you see where copied text will be inserted when you paste. To highlight
the current line, select Preferences > Editor/Debugger > Display and
under General Display Options, select the check box for Show caret row
highlighting. You can also specify the color used to highlight the line.
444
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
Comment Lines in Java, C, or C++ Program Files Now
Supported
You can now use the Text > Comment feature to comment selected lines in
Sun Microsystems Java, ANSI® C, and C++ program files. This adds the //
symbols at the start of the selected lines. Similarly, Text > Uncomment
removes the // symbols from the front of selected lines in Java, C, and C++
program files.
HTML File Indenting Feature Added as the Default
There is a new Editor/Debugger language preference for HTML files to specify
block indenting. By default, the preference is selected so block indenting
applies when typing text in HTML files.
In addition, you now can select Text > Smart Indent to apply smart
indenting to selected text in HTML files.
Compatibility Considerations. When typing text in HTML files, you will
automatically see block indenting because the preference is selected by
default.
445
Version 7.1 (R14SP3) MATLAB® Software
Incremental Search Now Supports Removing Characters
In incremental search, use Ctrl+G to remove characters back to the previous
successful string of characters found. For example, when searching for the
term plode, the text is not found and Failing appears in the incremental
search field. Ctrl+G automatically removes the de from the search term
because plo does exist in the file.
Emacs Key Binding for Select All
With the Emacs key bindings preference selected, use Ctrl+X, H to select all.
Change Case Added to Menu
Use new items in the Text menu to change the case of selected text. You can
also use the keyboard equivalents for changing case that existed in previous
versions—these are shown in the menu next to each item.
Nested Function Name No Longer in Status Bar
The Editor/Debugger no longer displays the current nested function name in
the status bar. Look in the M-file to view the current nested function name.
Tuning and Managing M-Files
New features and changes introduced in this version are described here.
Directory Reports Uses New Run Buttons
With Directory Reports displayed in the Web browser, you can use these
two new buttons:
• Rerun This Report — This updates the currently displayed report after
you have made changes to the report options or to any files in the current
directory.
• Run Report on Current Directory — Use this after changing the current
directory to run the same type of report for the new current directory.
These new buttons replace the Refresh button.
446
Desktop Tools and Development Environment, MATLAB® Version 7.1 (R14SP3)
Override %#ok with the New mlint -notok Option
There is a new option for the mlint function, '-notok' you can use to override
any statements that include %#ok (the symbol you add to the end of a line
instructing mlint to ignore the line). That is, mlint will run for all lines in
the file and will not ignore any statements.
Hyperlink Now Part of Messages Displayed by mlint
When you run the mlint function, the line number in the messages displayed
is a hyperlink that when clicked, opens the file in the Editor/Debugger
scrolled to that line number.
Profiler Button Added to Toolbar
There is now a button
on the MATLAB desktop toolbar to open the Profiler.
Publishing Results
New features and changes introduced in this version are described here.
Notebook Setup Changes; Some Arguments Removed
The notebook function setup behavior and syntax have changed.
When you run notebook('-setup'), MATLAB automatically obtains all the
information about your Microsoft Word application from the system registry
for yourWindows environment and you are no longer prompted to supply
the information.
In previous versions, when you configured Notebook, you ran
notebook ('-setup')
Notebook then prompted you to specify the version of Word you were using,
and if needed, the location of Word and its template directory. You could
supply the information using optional arguments to the notebook function:
notebook('-setup', wordversion, wordlocation, templatelocation)
Now, when you run notebook('-setup'), MATLAB automatically obtains all
the Word information from the registry for yourWindows environment.
447
Version 7.1 (R14SP3) MATLAB® Software
Compatibility Considerations. If you use notebook with the wordversion,
wordlocation, and templatelocation arguments in any of your files (for
example, startup.m), remove those arguments in your files. If you specify the
optional arguments, the notebook function runs and issues a warning, but
ignores the values. In a future release, MATLAB will issue an error when it
encounters notebook with these arguments.
Versions of Microsoft Word Application Supported by
Notebook; Microsoft Word 97 No Longer Supported
MATLAB Notebook supports the Microsoft Word version 2000 application.
Notebook also supports the Microsoft Word 2002 application and Microsoft
Word 2003 application, both for the Microsoft Windows XP platform.
Compatibility Considerations. As of MATLAB 7.1 (R14SP3), Notebook no
longer supports the Microsoft Word 97 application.
448
Mathematics, MATLAB Version 7.1 (R14SP3)
Mathematics, MATLAB Version 7.1 (R14SP3)
New features and changes introduced in this version are organized by these
topics:
• “New Functions” on page 449
• “Modified Functions” on page 450
• “Changes to accumarray” on page 450
• “Imposing Nonnegativity Constraints on Computed ODE Solution” on page
451
• “Mersenne Twister Support in rand” on page 451
• “svd Returns Economy Decomposition” on page 451
• “New Location for LAPACK Libraries” on page 452
• “Documentation on Data Analysis” on page 452
New Functions
The following functions are new in R14SP3:
Function
Description
hypot
Square root of sum of squares
mode
Finds most frequent values in sample
Compatibility Considerations
A new function name can potentially introduce a backward incompatibility
since it can, under certain circumstances, override a variable with the
same name as the new function. This is especially true for names that are
commonly used as variable names in program code.
An example of such a function name is the mode function, introduced in this
release. If you have M-file programs that use mode as a variable name, it is
possible under certain conditions for MATLAB to interpret these variable
names as function names by mistake. Read the section “Potential Conflict
with Function Names” in the MATLAB Programming documentation to find
out how to avoid having these variables misinterpreted.
449
Version 7.1 (R14SP3) MATLAB® Software
If your program code uses a user-written function named mode, you may find
that MATLAB calls the new MATLAB mode function instead of your own mode
function. To correct this, modify your MATLAB path by placing the location of
your own mode function closer to the beginning of the path string than the
location of the MATLAB mode.m file. The help for the addpath and rmpath
functions explains how to modify your MATLAB path.
Modified Functions
The following functions have been modified in MATLAB 7.1:
Function
Modified Behavior
accumarray
Allows more flexibility for input/output classes and
functions to be called
odeset
New NonNegative integration property to impose
nonnegativity constraints on an ODE solution
rand
Supports the Mersenne Twister algorithm in generating
random numbers
svd
Returns economy decomposition
Changes to accumarray
MATLAB Version 7.1 adds the following new features to the accumarray
function:
• The data type for the val input can be any numeric type, or logical, or
character.
• The data type for the subs input can be any numeric type.
• You can use a cell array of separate index vectors for the subs input.
• When you specify a function input argument, the value returned by
accumarray is given the same class as the values returned by that function.
• You can control the sparsity of the value returned by accumarray by
specifying the new input argument issparse.
450
Mathematics, MATLAB Version 7.1 (R14SP3)
Imposing Nonnegativity Constraints on Computed
ODE Solution
There is a new integration property called NonNegative that you can use
when applying ODE initial value problem solvers. If you need to solve a
problem in which certain components of the solution must be nonnegative,
use the NonNegative property to impose nonnegativity constraints on the
computed solutions.
See “Nonnegative Solutions” under “Calculus” in the MATLAB Mathematics
documentation for more information on this feature.
Mersenne Twister Support in rand
The rand function now supports a method of random number generation
called the Mersenne Twister. The algorithm used by this method, developed
by Nishimura and Matsumoto, generates double precision values in the closed
interval [2^(-53), 1-2^(-53)], with a period of (2^19937-1)/2.
For a full description of the Mersenne twister algorithm, see
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.
svd Returns Economy Decomposition
The following feature was released in MATLAB 7.0, but was undocumented
until this release.
The command svd(A,'econ') returns economy decomposition on matrices
having few rows and many columns as well as those with many rows and few
columns. svd(A,0) continues to behave as it always has, namely to only
return economy-sized decomposition on matrices having many rows and few
columns.
Note that this does not carry over to the qr function as there is no valid way of
cutting out any of the information returned by qr to make an economy-sized
decomposition of matrices having few rows and many columns.
451
Version 7.1 (R14SP3) MATLAB® Software
New Location for LAPACK Libraries
The location of the LAPACK libraries has been changed. These libraries
are now located in
extern/lib/win32/microsoft/libdflapack.lib
extern/lib/win32/microsoft/libmwlapack.lib
This change impacts you only if you build MEX-files that call LAPACK and
BLAS functions.
Documentation on Data Analysis
The section of the MATLAB Mathematics documentation on “Data Analysis
and Statistics” has been moved to a new MATLAB Data Analysis book.
This book documents MATLAB functions and tools that support basic data
analysis, including plotting, descriptive statistics, correlation, interpolation,
filtering, and Fourier analysis. It also documents the new object-oriented
command-line API for analyzing time-series data.
452
Data Analysis, MATLAB® Version 7.1 (R14SP3)
Data Analysis, MATLAB Version 7.1 (R14SP3)
New features and changes introduced in this version are described in this
section:
Data Analysis Documentation
The MATLAB 7.1 documentation includes a new Data Analysis book that
describes how to use MATLAB functions and tools for common data-analysis
tasks:
• Plotting
• Filtering
• Interpolation
• Descriptive statistics
• Correlation
• Data fitting using linear regression
• Fourier analysis
• Time-series analysis
Some of the content in Data Analysis is incorporated from the Mathematics
and Graphics books, such as data plotting, descriptive statistics, data fitting,
and Fourier analysis. All information about time-series analysis is new.
Time-Series Analysis
You can analyze time-series data using the new timeseries and
tscollection objects and methods, as well as the Time Series Tools graphical
user interface. This new functionality supports the following:
• Representation for univariate or multivariate MATLAB time series and
Simulink logged-signals data
• Built-in management of time units
• Removal or interpolation of missing data
• Resampling of data
453
Version 7.1 (R14SP3) MATLAB® Software
• Arithmetic operations for timeseries objects
• Synchronization of time series
Note Due to reported instabilities on the Linux 64 platform, you must
manually enable the Time Series Tools feature before starting Time Series
Tools.
To manually enable Time Series Tools on the LinuxLinux 64 platform, type
the following at the MATLAB prompt:
rehash toolboxcache
feature('TimeSeriesTools',1)
454
Programming, MATLAB Version 7.1 (R14SP3)
Programming, MATLAB Version 7.1 (R14SP3)
New features and changes are organized by these topics:
• “New Functions” on page 455
• “Modified Functions” on page 456
• “Evaluation Functions for Arrays, Structures, Cells” on page 457
• “Using who and whos with Nested Functions” on page 457
• “Date and Time Functions Support Milliseconds” on page 457
• “Stack Trace Provided for lasterror” on page 457
• “isfield Function Supports Cell Arrays; Results Might Differ from Previous
Version” on page 457
• “Support for Reading EXIF Data from Image Files” on page 458
• “Performance Improvements to the MATLAB JIT/Accelerator on
Macintosh” on page 459
• “Specifying fread Precision as Number of Bits” on page 459
• “Seconds Field Now Truncated; Results Might Differ” on page 460
• “Built-in Functions No Longer Use .bi; Impacts Output of which Function”
on page 460
• “New Warning About Potential Naming Conflict” on page 461
New Functions
This version introduces the following new functions:
Function
Description
arrayfun
Applies a given function to each element of an array.
This is especially useful for arrays of structures.
exifread
Reads EXIF information from JPEG and TIFF
image files
structfun
Applies a given function to each field of a structure
455
Version 7.1 (R14SP3) MATLAB® Software
Function
Description
swapbytes
Swaps byte ordering
typecast
Converts data types without changing underlying
data
Compatibility Considerations
A new function name can potentially introduce a backward incompatibility
since it can, under certain circumstances, override a variable with the same
name as the new function. This is especially true for names that are commonly
used as variable names in program code. Read the section “Potential Conflict
with Function Names” in the MATLAB Programming documentation to find
out how to avoid having these variables misinterpreted.
Modified Functions
The following functions were modified in this version:
Function
Modified Behavior
cellfun
Applies a given function to each cell of a cell array
datestr
Seconds field truncates instead of rounding
error
Saves stack information that you can retrieve using
lasterror
isfield
Supports cell array input
lasterror
Returns stack information on last error
rethrow
Accepts stack information as input
who, whos
Displays information separately for nested functions
Compatibility Considerations
The following functions might, under certain circumstances, return a different
value than what was returned in MATLAB 7.0.4 (R14SP2):
• datestr: Output might differ by 1 second from what was returned in a
previous version.
456
Programming, MATLAB Version 7.1 (R14SP3)
• isfield: Output might differ if you used this feature in a release in which
it was not officially supported.
Evaluation Functions for Arrays, Structures, Cells
MATLAB offers the capability to apply a given function to each element of an
array, each field of a structure, or each cell of a cell array. See the help on
arrayfun, structfun, and cellfun for more information.
Using who and whos with Nested Functions
When you use who or whos inside of a nested function, MATLAB returns or
displays all variables in the workspace of that function, and in the workspaces
of all functions in which that function is nested. This applies whether you
include calls to who or whos in your M-file code or if you call who or whos from
the MATLAB debugger. See thewho reference page for more information.
Date and Time Functions Support Milliseconds
The datestr, datenum, and datevec functions now support time specification
in milliseconds. Use the symbol .FFF to represent milliseconds in any of these
three functions. See the table labeled Free-Form Date Format Specifiers on
the datestr reference page for more information.
Stack Trace Provided for lasterror
The lasterror function now returns an additional field in the structure that
it returns. The new stack field contains information from the stack on the
M-file, function, and line in which the error occurred.
You can use this stack information to track down the source of an error, or as
an input to the rethrow function. When used with rethrow, MATLAB sets
the stack of the rethrown error to the value contained in the stack input.
isfield Function Supports Cell Arrays; Results Might
Differ from Previous Version
The isfield function now supports cell array input as shown in this example.
Check structure S for any of four possible field names. In this case, only the
first is found, so the first element of the return value is set to true:
457
Version 7.1 (R14SP3) MATLAB® Software
S = struct('one', 1, 'two', 2);
fields = isfield(S, {'two', 'pi', 'One', 3.14})
fields =
1
0
0
0
Compatibility Considerations
There might be backward compatibility issues associated with this change
if you used isfield with cell array input in a previous release. In previous
releases, although isfield might have worked with this type of input in
certain cases, it was not officially a supported feature. If you used this
previously unsupported syntax in previous releases, you may see a change in
the content and/or size of the return values in this release.
For example, create a structure s with three fields a, b, and c created in that
order. In MATLAB 7.0.4, isfield called with a cell array input returns
true if any of the elements of the cell array matches a field name, and if
that element is in the same position in the cell array as the field is in the
structure. This is true for 'c':
isfield(s, {'b'; 'a'; 'c'})
ans =
1
In MATLAB 7.1, isfield returns true for each element in the cell array that
matches a field name, regardless of where the string is positioned in the cell
array. This is true for 'a', 'b', and 'c':
isfield(s, {'b'; 'a'; 'c'})
ans =
1
1
1
Support for Reading EXIF Data from Image Files
You can now read EXIF (Exchangeable Image File Format) data from JPEG
and TIFF graphics files using the new exifread function. EXIF is a standard
used by digital camera manufacturers to store information in the image file,
458
Programming, MATLAB Version 7.1 (R14SP3)
such as the make and model of a camera, the time the picture was taken and
digitized, the resolution of the image, exposure time, and focal length.
Performance Improvements to the MATLAB
JIT/Accelerator on Macintosh
The JIT/Accelerator for MATLAB, introduced in MATLAB Version 6.5 for
Windows and UNIX, is now also supported on Macintosh systems. The
JIT/Accelerator affects the performance of MATLAB and can give you a
substantial performance increase over earlier MATLAB versions for many
MATLAB applications.
Specifying fread Precision as Number of Bits
The following information on the fread function applies to MATLAB 7.1
and also to earlier versions.
MATLAB provides the following method of specifying a precision argument
in a call to fread:
input_format=>output_format
For example, to read 50 8-bit unsigned integers from a file and convert them
to characters, you can use
c = fread(fid, 50, 'uint8=>char')'
If the input format and output format are the same, you can abbreviate the
precision specifier by using
*input_format
For example, you can replace
c = fread(fid, 50, 'uint8=>uint8')'
with
c = fread(fid, 50, '*uint8')'
You can also use this notation with an input stream that is specified as
a number of bits (e.g., bit4 or ubit18). MATLAB translates this into an
459
Version 7.1 (R14SP3) MATLAB® Software
output type that is a signed or unsigned integer (depending on the input
type), and which is large enough to hold all of the bits in the source format.
For example, *ubit18 does not translate to ubit18=>ubit18, but instead to
ubit18=>uint32.
Seconds Field Now Truncated; Results Might Differ
When handling time data, MATLAB now truncates the seconds field instead
of rounding it. This is consistent with the way that MATLAB handles hours
and minutes.
For example, using MATLAB 7.0.4 (R14SP2), datestr returns
t = datestr('11:30:01.666')
t =
01-Jan-2005 11:30:02
while MATLAB 7.1 (R14SP3) returns
t = datestr('11:30:01.666')
t =
01-Jan-2005 11:30:01
Compatibility Considerations
If your M-files relied on the previous behavior, you might get different results.
Built-in Functions No Longer Use .bi; Impacts Output
of which Function
In previous releases, MATLAB function dispatching located built-in functions
by means of special files having a .bi file extension. MATLAB no longer uses
this mechanism to locate built-in functions. All .bi files have been removed
in MATLAB 7.1.
Compatibility Considerations
If you have M-files that relied on built-in files having a .bi extension, your
files need to accommodate this change.
There are changes in how MATLAB displays built-in functions using which:
460
Programming, MATLAB Version 7.1 (R14SP3)
In MATLAB 7.0.4 (R14SP2),
which -all int32
\\matlab\toolbox\symbolic\@sym\int32.m
\\matlab\toolbox\matlab\datatypes\int32.bi
\\matlab\toolbox\matlab\datatypes\int32.m
% sym method
% Shadowed
% Shadowed
In MATLAB 7.1 (R14SP3),
which -all int32
built-in (\\matlab\toolbox\matlab\datatypes\int32)
\\matlab\toolbox\symbolic\@sym\int32.m
% sym method
New Warning About Potential Naming Conflict
If you change directories (cd) or add a new directory to your current MATLAB
path, and the new directory contains an M-file having the same name as a
MATLAB built-in function, MATLAB now displays a warning alerting you to
the potential naming conflict. For example,
Warning: Function D:\test\matlab\disp.m has the same name as a
MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.
In general, any file system event that leads to path refreshing in MATLAB
can trigger this warning if the directory involved in this event has such a
user function under it.
Compatibility Considerations
MATLAB might generate warnings about naming conflicts that did not
appear in previous versions. To avoid this warning, renaming your M-files
that have name conflicts with built-in functions.
461
Version 7.1 (R14SP3) MATLAB® Software
Graphics and 3-D Visualization, MATLAB Version 7.1
(R14SP3)
This version introduces the new features and changes described below.
Plot Tools Now Available on Mac Platform
As a consequence of enabling Java figures on Macintosh, the Plot Tools user
interface is now available to Mac users, enabling them to interactively add
data to plots, change plot symbology, and otherwise customize their data plots.
Documentation for Data Analysis Reorganized
Documentation explaining techniques for analyzing graphical data has been
shifted from the Graphics book of the MATLAB documentation to a new book
called Data Analysis.
462
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.1 (R14SP3)
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.1 (R14SP3)
Plans for Obsolete Functions
The table below indicates functions that were designated as obsolete prior to
R14SP3 and that will be removed in a future version.
Compatibility Considerations
If you use these functions, you should use replacement functions instead.
Obsolete
Function
Removed from
Version
Replacement
clruprop
Future version
rmappdata
ctlpanel
Future version
guide
extent
Future version
get(txtobj,'extent')
figflag
Future version
findobj to determine if
figure exists.
figure(fighandle) to bring
figure to front and give it
focus.
getuprop
Future version
getappdata
hthelp
Future version
web
layout
Future version
None provided
matq2ws
Future version
None provided
matqdlg
Future version
None provided
matqparse
Future version
None provided
matqueue
Future version
None provided
menuedit
Future version
guide
menulabel
Future version
Use '&' to specify mnemonics
and 'Accelerator' property
to define accelerator keys.
463
Version 7.1 (R14SP3) MATLAB® Software
464
Obsolete
Function
Removed from
Version
Replacement
setuprop
Future version
setappdata
wizard
Future version
None provided
ws2matq
Future version
None provided
External Interfaces/API, MATLAB® Version 7.1 (R14SP3)
External Interfaces/API, MATLAB Version 7.1 (R14SP3)
• “mex Switches Now Supported on Microsoft Windows” on page 465
• “New COM Programmatic Identifier” on page 466
• “New File Extension for MEX-Files on Windows Systems” on page 466
• “New Preferences Directory and MEX Options” on page 468
• “Compiler Support” on page 469
• “Import Libraries Moved” on page 469
• “MEX Perl Script Moved” on page 470
• “Linking to System Libraries” on page 470
• “COM Automation Server Now Displays Figure” on page 470
mex Switches Now Supported on Microsoft Windows
MATLAB now supports the -l and -L options to the mex command on
Windows operating systems. In previous releases of MATLAB, these options
were supported only on UNIX systems.
Switch
Description
-l
Specifies additional libraries to link against.
Note On Windows operating systems, the -l option can
specify libraries of two forms. For example, specifying -l
name matches either name.lib or libname.lib, whereas
on UNIX it matches only libname.lib.
-L
Specifies a path to use when MATLAB searches for
library files specified with the -l option. The -L option
must precede the -l option.
For the switches you can use with the mex command, see the “MEX Script
Switches” table in the “Custom Building MEX-Files” section of “Calling C/C++
and Fortran Programs from MATLAB Command Line” in the MATLAB
External Interfaces documentation.
465
Version 7.1 (R14SP3) MATLAB® Software
New COM Programmatic Identifier
There is now a ProgID that enables you to use the full desktop version of
MATLAB as an automation server.
Matlab.Desktop.Application starts an automation server using the most
recent version of MATLAB that is installed on your system.
New File Extension for MEX-Files on Windows
Systems
MATLAB now uses the extension .mexw32 for MEX-files on 32-bit versions of
Windows systems. In previous versions, MATLAB used the extension .dll.
MathWorks recommends that you recompile all MEX-files after installing
MATLAB 7.1. MEX-files compiled in MATLAB 7.0.4 with .dll extensions
should still work in MATLAB 7.1.
There may be two MEX-files with the same name, except that one has a
.mexw32 extension and the other has a .dll extension. When these files are
both on the MATLAB search path:
• If the two files are in the same directory, MATLAB uses the .mexw32 file.
• If the two files are in different directories, MATLAB uses the file in the
directory that is higher on the search path.
If you want one of these two files to take precedence over the other, ensure
that the directory that contains the file you want MATLAB to use is higher
on the search path than the directory that contains the file you do not want
MATLAB to use.
Compatibility Considerations
Previous versions of MATLAB do not recognize MEX-files compiled in
MATLAB 7.1 with .mexw32 extensions. However, you can use the mex
-output option in MATLAB 7.1 to build a MEX-file with a .dll extension
that earlier versions of MATLAB can recognize.
You may need to update any MATLAB scripts or makefiles that explicitly
expect .dll extensions for compiled MEX-files. You can use the mexext
466
External Interfaces/API, MATLAB® Version 7.1 (R14SP3)
function in MATLAB to obtain the extension for the platform and version you
are working on. A new mexext script obtains the appropriate extension when
executed from outside MATLAB, as in a makefile.
On Windows systems, MATLAB issues warnings at MEX setup time, compile
time, and run-time to notify you of possible incompatibilities resulting from
the change in MEX-file extension from .dll to .mexw32.
New mex–output Behavior for Compatibility
The -output option to mex specifies the filename of the compiled MEX-file.
In general, mex ignores any filename extension supplied in the -output
argument and uses the extension for the compiled file that is appropriate for
the architecture. However, on Windows systems, if the -output argument
specifies a .dll extension, the compiled file has this extension instead of
.mexw32. Previous versions of MATLAB can recognize the resulting compiled
file.
Conflicting MEX-Files Renamed Automatically
If two files with the same name but with .mexw32 and .dll extensions exist
in the same directory, MATLAB uses the .mexw32 file. To avoid unintended
shadowing, MATLAB automatically renames compiled MEX-files under the
following circumstances:
• When you build a MEX-file with a .mexw32 extension and the directory
contains an existing file with the same name, but with a .dll extension,
the extension of the .dll file is changed to .dll.old.
• When you build a MEX-file with a .dll extension (using the mex -output
option) and the directory contains an existing file with the same name, but
with a .mexw32 extension, the extension of the .mexw32 file is changed
to .mexw32.old.
New Return Value for mexext on Windows Systems
On 32-bit Windows platforms, the mexext function now returns mexw32. In
MATLAB 7.0.4 it returned dll.
467
Version 7.1 (R14SP3) MATLAB® Software
New mexext Script to Obtain MEX-File Extension in Makefiles
A new script displays the MEX-file extension in the current version of
MATLAB that corresponds to the platform on which the script is executed.
It is intended to be used outside MATLAB, in makefiles or scripts, to obtain
the appropriate filename extension for compiled MEX-files. Use this script
instead of explicitly specifying the MEX-file extension in a makefile.
The script is named mexext.bat on Windows platforms and mexext.sh on
UNIX platforms. It is located in the directory $matlab/bin, where $matlab
represents the string returned from the matlabroot command.
The script displays the MEX-file extension without a leading period. For
example, on 32-bit Windows platforms, it returns mexw32.
Following is a fragment of a GNU makefile that uses the mexext script to
obtain the MEX-file extension:
ext = $(shell mexext)
yprime.$(ext) : yprime.c
mex yprime.c
New Preferences Directory and MEX Options
The MATLAB preferences directory has changed. In MATLAB 7.1, the
preferences directory is named R14SP3. In previous R14 releases, the
preferences directory was named R14. For more information, see the
documentation for prefdir, which returns the preferences directory.
Compatibility Considerations
When you install MATLAB 7.1, MATLAB migrates some files from any
existing R14 preferences directory to the new R14SP3 directory. However,
MATLAB does not migrate the MEX options file, mexopts.bat. If you want to
preserve any MEX options that you have customized in an earlier R14 release,
you need to migrate your options to the new R14SP3 preferences directory.
You can migrate your MEX options in either of two ways:
468
External Interfaces/API, MATLAB® Version 7.1 (R14SP3)
• If you have customized only a few options: Invoke mex with the -setup
option to create a new mexopts.bat file in the R14SP3 preferences directory.
Edit the new mexopts.bat file to customize the MEX options there.
• If you have customized many options: Copy your customized mexopts.bat
file from the old R14 preferences directory to the new R14SP3 directory.
Edit at least the settings of the LIBLOC and NAME_OUTPUT linker
parameters in the mexopts.bat file. These lines should look as follows on
Windows systems when using a Microsoft compiler:
set LIBLOC=%MATLAB%\extern\lib\win32\microsoft
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
The LIBLOC parameter has changed because import libraries have moved; see
“Import Libraries Moved” on page 469. The value of this parameter depends
on the platform you are running MATLAB on and the vendor of the compiler
you are using.
The NAME_OUTPUT parameter has changed because the extension for compiled
MEX-Files has changed on Windows systems; see “New File Extension for
MEX-Files on Windows Systems” on page 466.
Compiler Support
The set of compilers that MATLAB supports has changed in MATLAB
7.1. For an up-to-date list of supported compilers, see the Supported and
Compatible Compilers Web page.
Compatibility Considerations
You may need to recompile code compiled with an earlier compiler that is
no longer supported.
Import Libraries Moved
The import libraries (.lib files) for the MATLAB dll files have been moved
up a directory level and are no longer specific to the compiler version. The
new location for these files is
$matlab/extern/lib/$arch/$vendor
469
Version 7.1 (R14SP3) MATLAB® Software
where the terms $matlab, $arch, and $vendor respectively represent the
string returned from the matlabroot command, the platform you are running
MATLAB on, and the vendor of the compiler you are using.
Compatibility Considerations
You may need to change any code that depends on the previous library
locations.
MEX Perl Script Moved
The MEX Perl script used in building MEX-files is now located in
$matlab/bin, rather than $matlab/bin/win32. (The term $matlab
represents the string returned by the matlabroot function.) You should not
notice any difference, however, as a batch file located in $matlab/bin/win32
provides backward compatibility.
Linking to System Libraries
MATLAB now links with the system libraries by default. You no longer need
to specify them explicitly.
COM Automation Server Now Displays Figure
When using MATLAB as an Automation server, executing MATLAB
commands that create figures now displays the figure window.
Previous releases of MATLAB created the figure in the background. To
duplicate the old behavior, create a figure with its Visible property set to
off, then set the property to on when you want the figure to be visible:
h = actxserver('matlab.application');
h.Execute('figure visible off');
h.Execute('plot(1:10)');
h.Execute('set(gcf,''visible'',''on'')');
470
Version 7.0.4 (R14SP2)
MATLAB Software
This table summarizes what’s new in Version 7.0.4 (R14SP2):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Bug Reports at
Web site
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.0.4
(R14SP2)” on page 473
• “Mathematics, MATLAB Version 7.0.4 (R14SP2)” on page 480
• “Programming, MATLAB Version 7.0.4 (R14SP2)” on page 481
• “Graphics and 3-D Visualization, MATLAB Version 7.0.4 (R14SP2)” on
page 487
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.0.4
(R14SP2)” on page 488
471
Version 7.0.4 (R14SP2) MATLAB® Software
• “External Interfaces/API, MATLAB Version 7.0.4 (R14SP2)” on page 489
472
Desktop Tools and Development Environment, MATLAB® Version 7.0.4 (R14SP2)
Desktop Tools and Development Environment, MATLAB
Version 7.0.4 (R14SP2)
New features and changes are organized by these topics:
• “Installation Folder with Spaces” on page 473
• “Startup and Shutdown” on page 474
• “Desktop” on page 474
• “Running Functions — Command Window and History” on page 475
• “Help” on page 475
• “Workspace, Search Path, and File Operations” on page 476
• “Editing and Debugging M-Files” on page 477
• “Source Control Interface” on page 478
• “Publishing Results” on page 478
Installation Folder with Spaces
In MATLAB 7.0.4 (R14SP2) software, the following two changes have been
made to the MathWorks Installer on Microsoft Windows platforms:
• The Installer now allows a folder name with spaces in the installation path.
• The Installer honors the default installation folder for Windows software,
which on most machines is Program Files.
These changes were made in response to many customer requests and the
desire to conform to a widely established industry practice for the PC platform.
Note MathWorks products are used and integrated into many software
environments. If you use MathWorks products in conjunction with other third
party applications (compilers, other numerical analysis packages, etc.) you
might want to continue installing into a folder that does not have spaces in
the path until you have tested that those applications work with MathWorks
products.
473
Version 7.0.4 (R14SP2) MATLAB® Software
Startup and Shutdown
Confirmation Dialog Box for Quitting Added
When quitting MATLAB, a confirmation dialog box appears if you set a new
preference for that purpose. By default, the confirm quitting preference is
not set, so the dialog box will not appear. To change the preference, see
the instructions for “Confirmation Dialogs Preferences” in the desktop
documentation.
JVM Software Updated
MATLAB is now using version 1.5 of Sun Microsystems Java JVM software
on Windows, Linus Torvalds Linux (32-bit), and Sun Microsystems Solaris
platforms. Java software is supplied with MATLAB, so this change requires
no action on your part.
Compatibility Considerations
If you use a specific version of Java with MATLAB on Windows, Linux 32-bit,
or Solaris platforms, this change might affect you.
Desktop
Confirmation Dialog Boxes Preference Introduced
There are new preferences for displaying or not displaying confirmation
dialog boxes for desktop tools. In previous versions, some of these preferences
existed but were located with other preferences for the associated desktop
tool. They are now organized in one preference panel for all desktop tools.
Access them by selecting File > Preferences > General > Confirmation
Dialogs. These preferences work in conjunction with the Do not show this
prompt again check boxes that appears on various desktop confirmation
dialog boxes. For more information, see “Confirmation Dialogs Preferences”
in the desktop documentation.
474
Desktop Tools and Development Environment, MATLAB® Version 7.0.4 (R14SP2)
Running Functions — Command Window and History
Overwrite Mode Now Supported
The Command Window now supports overwrite mode. Press the Insert key to
enter text in overwrite mode. Press the Insert key again to return to entering
text in insert mode. View the current state at the far right end of the status
bar of the Command Window when it is undocked, or in the desktop when
the Command Window is docked and has focus. In insert mode, OVR in the
status bar is gray and the cursor has a wide block shape.
Hyperlink Color Preference Added
Set the color of hyperlinks that display in the Command Window. Select
File > Preferences > Command Window, and under Display, select
Hyperlink color.
Help
Subfunction Help Syntax Changed
To get help for a subfunction, use
help functionname>subfunctionname
Compatibility Considerations
In previous versions, the syntax was help functionname/subfunctionname.
This change was introduced in R14 (MATLAB 7.0) but was not documented.
Bug Fixes and Known Problems Now on Web; No Longer
Found Via Help Search
The Release Notes sections “Major Bug Fixes” and “Known Software and
Documentation Problems” no longer include the content in the installed help
files. Instead, the sections provide links to these lists on the MathWorks
Web site. The lists on the Web site can be updated after the release date to
reflect the latest information.
475
Version 7.0.4 (R14SP2) MATLAB® Software
Compatibility Considerations
As a result of this change, the Help browser Search feature will not find
search terms that are in the content of those reports. Use the MathWorks
Web site search features to look for search terms in those reports.
Workspace, Search Path, and File Operations
Formatting Decimal Separator when Copying From the Array
Editor
You can now specify how you want decimal numbers to be formatted when
you cut or copy cells from the Array Editor and paste them into text files or
other applications. You can specify a separator for this purpose in the Array
Editor panel of the Preferences dialog. The Decimal separator to use
when copying edit field is by default "." (period). If you are working in or
providing data to a locale that uses a different character to delimit decimals,
type that character in this edit field and click OK or Apply.
Workspace Browser Preference Panel Removed
The Workspace browser preferences panel was removed. The entry on that
panel was for confirming deletion of variables. That preference is now part of
General > Confirmation Dialogs preferences.
Compatibility Considerations
Use File > Preferences > General > Confirmation Dialogs instead of
File > Preferences > Workspace Browser.
Current Directory Browser Preferences Added
There are new Current Directory browser preferences you can access by
selecting File > Preferences > Current Directory Browser, Browser
display options:
• View the file size by selecting the Show file sizes check box. (This is
selected by default.)
476
Desktop Tools and Development Environment, MATLAB® Version 7.0.4 (R14SP2)
• For models created with Simulink software, view brief descriptions in
the Description column when Show M and MDL file descriptions
is selected.
• For models created with Simulink, view the complete descriptions in
the lower pane when the preference for Show M, MDL and MAT file
contents is selected. This allows you to view information about a model
without running Simulink.
Editing and Debugging M-Files
Go To Subfunction or Nested Function
Go directly to a subfunction or nested function within an M-file using the
enhanced Go To dialog box. Access the dialog box by selected Edit > Go To.
Click the Name column header to arrange the list of functions alphabetically,
or click the Line column header to arrange the list by the position of the
functions in the file.
Help Browser Now Accessible from MATLAB Stand-Alone Editor
You can now access the MATLAB Help browser from the MATLAB
stand-alone Editor. This provides you with documentation for MATLAB,
including using Editor features and MATLAB functions.
Preference for Editor/Debugger Dialog Moved
The Show dialog prompt preference has been moved to
Preferences > General > Confirmation Dialogs. For more information,
see “Confirmation Dialogs Preferences” in the desktop documentation.
Compatibility Considerations
Use File > Preferences > General > Confirmation Dialogs instead of
File > Preferences > Editor/Debugger to set this preference.
Dragging Text Maintains Font and Highlighting
Now, when you drag text from the Editor/Debugger to another application, it
maintains the syntax highlighting and font characteristics.
477
Version 7.0.4 (R14SP2) MATLAB® Software
Source Control Interface
Register Project Feature Added; Add to Source Control
Behavior Changed
There is a new source control interface feature for Windows platforms,
Register Project with MATLAB. Use this to associate all files in a directory
with a source control project. You perform this for any file in a directory,
which registers the directory and all files in that directory. You only perform
this once in a directory, and must perform it before you perform any other
source control actions for files in that directory.
Access the feature in the Current Directory browser by right-clicking a file
and selecting Source Control > Register Your Source Control System
Project with MATLAB from the context menu. You can also access it from
the Editor/Debugger File menu. To access the feature for files created with
Simulink or Stateflow® software, use the Current Directory browser.
For a summary of the process, see the topic “Source Control Interface on
Microsoft Windows” in the desktop documentation.
Compatibility Considerations
In previous releases, this feature was part of the Add to Source Control
feature. You still need to add each file to source control, but you do this after
first registering the directory that contains the file.
Project Name Exact Match No Longer Required
The name of the project in the source control system is no longer required to
exactly match the name of the directory on disk containing the files.
Publishing Results
Cell Publishing: File Extension Changes
The files created when publishing using cells now have more natural
extensions. JPEG files now have a .jpg instead of a .jpeg extension, and
EPSC2 files now have an .eps instead of an .epsc2 extension.
478
Desktop Tools and Development Environment, MATLAB® Version 7.0.4 (R14SP2)
Compatibility Consideration
If you relied on the formerly used file extensions, you need to accommodate
the changes.
Cell Publishing: LaTeX Image File Type Changes
Publishing to LaTeX now respects the image file type you specify in
preferences rather than always using EPSC2 files.
Cell Publishing: Image Options More Restrictive
The Publish image options in Editor/Debugger preferences for Publishing
Images have changed slightly. The changes prevent you from choosing
invalid formats.
Notebook Support for Microsoft Word 97 Application to be
Discontinued
Notebook will no longer support the Microsoft Word 97 application starting in
the next release of MATLAB.
Compatibility Considerations
If you use Word 97 with Notebook, you will need to migrate to a more recent
version.
479
Version 7.0.4 (R14SP2) MATLAB® Software
Mathematics, MATLAB Version 7.0.4 (R14SP2)
This version introduces the following new features and changes:
• “New Vendor BLAS Used for Linear Algebra in MATLAB” on page 480
• “max and min on Complex Integers Not Supported” on page 480
New Vendor BLAS Used for Linear Algebra in MATLAB
MATLAB uses Basic Linear Algebra Subprograms (BLAS) for its vector inner
product, matrix-vector product, matrix-matrix product, and triangular solvers
in \. MATLAB also uses BLAS behind its core numerical linear algebra
routines from Linear Algebra Package (LAPACK), which are used in functions
like chol, lu, qr, and within the linear system solver \.
Starting in this release
• On Macintosh, MATLAB now uses the Accelerate framework.
• On 64-bit Linux, MATLAB uses Intel® Math Kernel Library (MKL) 7.0.1 on
Intel chips, and AMD Core Math Library (ACML) 2.0 on AMD chips.
max and min on Complex Integers Not Supported
Using the max and min functions on complex integer inputs (as shown in the
example below) is no longer supported. This operation had been supported
from release R11 through R14SP1, but now returns an error.
max(int8([3-4i 3+4i]))
Compatibility Considerations
Any code that calls max or min on complex integers should be removed from
your program files.
480
Programming, MATLAB Version 7.0.4 (R14SP2)
Programming, MATLAB Version 7.0.4 (R14SP2)
This version introduces the following new features and changes:
• “Memory-Mapping” on page 481
• “textscan Enhancements” on page 482
• “xlsread Enhancements” on page 482
• “xlsread Imported Date Format Changes” on page 482
• “format Options Added” on page 482
• “Nonscalar Arrays of Function Handles to Become Invalid” on page 483
• “Assigning Nonstructure Variables As Structures Displays Warning” on
page 483
• “Function Declaration Compatibililty with Pre-R14 M-Files” on page 485
Memory-Mapping
Memory-mapping is a mechanism that maps a portion of a file, or an entire
file, on disk to a range of addresses within an application’s address space. The
application can then access files on disk in the same way it accesses dynamic
memory. This makes file reads and writes faster in comparison with using
functions such as fread and fwrite.
Another advantage of using memory-mapping in MATLAB is that it enables
you to access file data using standard MATLAB indexing operations. Once
you have mapped a file to memory, you can read the contents of that file
using the same type of MATLAB statements used to read variables from the
MATLAB workspace. The contents of the mapped file appear as if they were
an array in the currently active workspace. You simply index into this array
to read or write the desired data from the file.
Memory-mapped files also provide a mechanism for sharing data between
applications. This is achieved by having each application map sections of
the same file. This feature can be used to transfer large data sets between
MATLAB and other applications.
481
Version 7.0.4 (R14SP2) MATLAB® Software
textscan Enhancements
The textscan function originally read data only from files. As of this release,
you can use textscan to read from strings as well.
xlsread Enhancements
In this release, you can write a function and pass a handle to this function to
xlsread. When xlsread executes, it reads from the spreadsheet, executes
your function on the data read from the spreadsheet, and returns the final
results to you.
You can use either of the following syntaxes:
num = xlsread('filename', ..., functionhandle)
[num, txt, raw, X] = xlsread('filename', ..., functionhandle)
For an example, see the xlsread reference page.
xlsread Imported Date Format Changes
In MATLAB versions prior to R14, date values read into MATLAB from an
Excel spreadsheet using xlsread were always imported as numeric date
values. The R14 and later releases of MATLAB import dates in the format in
which they were stored in the Excel file. Dates stored in string or date format
are now imported as strings by xlsread. Dates stored in numeric format
are imported as numeric date values.
Compatibility Considerations
Because of a difference in the way Excel and MATLAB compute numeric
date values, any numeric dates imported from Excel into MATLAB must
be converted to the MATLAB format before being used in the MATLAB
application. For more information, see “Converting Dates”.
format Options Added
You can display MATLAB output using two new formats: short eng and
long eng. See the format reference page for more information.
482
Programming, MATLAB Version 7.0.4 (R14SP2)
• short eng — Displays output in an engineering format that has at least
5 digits and a power that is a multiple of three.
• long eng — Displays output in an engineering format that has exactly 16
significant digits and a power that is a multiple of three.
format short eng
pi
ans =
3.1416e+000
format long eng
pi
ans =
3.14159265358979e+000
Nonscalar Arrays of Function Handles to Become
Invalid
Creation of nonscalar arrays of function handles by str2func may be invalid
or may return different results in future versions of MATLAB, but will
continue to work in R14.
Compatibility Considerations
To avoid this warning and prepare for this change, convert the cell array of
strings to a cell array of function handles.
For more information, type help function_handle and see the section
entitled Note on Backward Compatibility.
Assigning Nonstructure Variables As Structures
Displays Warning
Assigning to a nonstructure variable as if it were a structure is not
recommended in MATLAB. For example, if variable x holds a double (as
shown below), then attempting to add a fieldname to it, thus converting x to a
structure, is not good programming practice and should generate an error.
x = 10;
x.name = magic(3);
483
Version 7.0.4 (R14SP2) MATLAB® Software
Note that if x were empty (i.e., x == []), then assigning a field to it as if it
were already a structure is acceptable.
Behavior Prior to Release R14
Because of a bug in releases of MATLAB prior to R14, you can assign a field
to a nonempty, nonstructure variable in those releases without MATLAB
generating a warning message or error. The result is that MATLAB quietly
converts the variable to a structure:
x = 10;
class(x)
ans =
double
x.name = magic(3);
% Invalid expression completes
%
without warning or error.
class(x)
ans =
struct
Behavior In R14 and Later
In the MATLAB R14 and R14 service pack releases, you can still perform this
type of operation, but MATLAB now displays a warning message:
x = 10;
x.name = magic(3);
Warning: Struct field assignment overwrites a value with class
"double".
In a future release of MATLAB, attempting this type of operation will throw
an error instead of just displaying a warning message.
Compatibility Considerations
You are encouraged to modify any code that generates this warning. The
section “Making a Valid Assignment” on page 485 gives instructions on how to
do this.
484
Programming, MATLAB Version 7.0.4 (R14SP2)
Another Case — Extending the Depth of a Structure
The same rules apply when extending the depth of a structure by adding
additional, lower-level fields. The first line of the example shown below
creates a structure named handle and assigns to it a field of type double
named output. The line after that treats this double as if it were a structure
by attempting to assign a field named time to it. The second line is an invalid
expression:
handle.output = 5;
handle.output.time = 13;
As in the case discussed earlier, this assignment does not generate a warning
or error in MATLAB releases prior to R14. In the R14 and R14 service pack
releases of MATLAB, you get the warning shown in the previous example.
Beginning in a future release of MATLAB, this assignment will throw an
error.
Making a Valid Assignment
To avoid this warning and future errors, first make x an empty structure or
empty array as shown here. Once a variable is established as a structure or
empty array, you can assign fields to it without getting an error:
x = struct;
or
x.name = magic(3);
x = [];
In the case of extending the depth of an existing structure, you can perform
this type of assignment without generating a warning or error using the
struct function as shown here:
handle.output = struct('time', 13);
Function Declaration Compatibililty with Pre-R14
M-Files
As of Release 14, the function definition line in a function M-file no longer
requires commas separating output variables. However, because this syntax
is not compatible with earlier releases, you should always include the comma
separators when writing an M-file function that you intend to run on releases
both earlier and later than Release 14.
485
Version 7.0.4 (R14SP2) MATLAB® Software
Compatibility Considerations
See “Comma Separators Not Required in Function Declaration” on page 593
in the Release 14 release notes.
486
Graphics and 3-D Visualization, MATLAB® Version 7.0.4 (R14SP2)
Graphics and 3-D Visualization, MATLAB Version 7.0.4
(R14SP2)
This version introduces the following new feature:
imwrite Now Supports GIF Export
The imwrite function now supports exporting image data in Graphics
Interchange Format (GIF).
Compatibility Considerations
The MATLAB 7.0.4 graphics features have the following platform limitations:
Cannot Dock Figures on Macintosh
You cannot dock figures in the Desktop, because MATLAB uses native figure
windows on the Macintosh platform.
Plotting Tools Not Working on Macintosh
The plotting tools are not supported on the Macintosh platform. This
means the Figure Palette, Plot Browser, and Property Editor do not work
these platforms. To use the MATLAB 6 Property Editor, see the propedit
command.
Not All Macintosh System Fonts Are Available
MATLAB figures do not support the same fonts as native Macintosh
applications. Use the uisetfont functions to see which fonts are available in
the MATLAB environment.
XDisplay Property Setable on Motif-Based Systems
You can specify the value of the figure XDisplay property only on systems
using Motif-Based figure windows.
487
Version 7.0.4 (R14SP2) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.0.4 (R14SP2)
New Callbacks Chapter
The Creating Graphical User Interfaces documentation offers a new chapter,
in draft form, that attempts to bring information regarding callbacks into one
place. It introduces the concepts and mechanisms with which you work, and
explains some basic techniques for programming your GUI’s behavior. This
chapter is not yet complete, but you may find it useful, even in its current
state, particularly if you are new to creating GUIs.
Temporarily, this new chapter appears as Appendix A, “Working with
Callbacks (Draft).” It contains some new information, but also duplicates
information that can be found in various places throughout the rest of the
book. In cases where information has not yet been included in the new
chapter, links take you to the main part of the book.
488
External Interfaces/API, MATLAB® Version 7.0.4 (R14SP2)
External Interfaces/API, MATLAB Version 7.0.4 (R14SP2)
New features and changes introduced in this version are described here.
New File Archiving Functions and Functionality
In addition to being able to zip and unzip compressed file archives, MATLAB
software now supports the following archiving functions:
• gzip/gunzip — Compress/uncompress files in gzip format.
gunzip reads archives from both file systems and URLs.
• tar/untar — Compress/extract files in a tar-file.
untar reads archives from both file systems and URLs.
• The unzip function can now also open a zip archive from a URL.
489
Version 7.0.1 (R14SP1)
MATLAB Software
This table summarizes what’s new in Version 7.0.1 (R14SP1):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Fixed bugs
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7.0.1
(R14SP1)” on page 493
• “Mathematics, MATLAB Version 7.0.1 (R14SP1)” on page 499
• “Programming, MATLAB Version 7.0.1 (R14SP1)” on page 503
• “Graphics, MATLAB Version 7.0.1 (R14SP1)” on page 509
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7.0.1
(R14SP1)” on page 510
491
Version 7.0.1 (R14SP1) MATLAB® Software
• “External Interfaces/API, MATLAB Version 7.0.1 (R14SP1)” on page 513
492
Desktop Tools and Development Environment, MATLAB® Version 7.0.1 (R14SP1)
Desktop Tools and Development Environment, MATLAB
Version 7.0.1 (R14SP1)
New features and changes are organized by these topics:
• “Startup and Shutdown” on page 493
• “Desktop” on page 493
• “Running Functions — Command Window and Command History” on page
494
• “Help” on page 495
• “Workspace, Search Path, and File Operations” on page 495
• “Editing and Debugging M-Files” on page 496
• “Source Control Interface” on page 497
• “Publishing Results” on page 497
Startup and Shutdown
Construction of Classpath for Java Software Now Uses
librarypath
When the MATLAB software starts, it now uses librarypath.txt as well
as classpath.txt to construct the classpath for Sun Microsystems Java
software.
Compatibility Considerations. If you call Java software from MATLAB,
refer to “Locating Native Method Libraries” in the MATLAB External
Interfaces documentation for details. This change was part of MATLAB 7.0.
Desktop
System Web Browser Used for Large Files
The MATLAB Web browser displays files up to 1.5 MB. When the Web browser
tries to open a file greater than 1.5 MB, MATLAB instead automatically
displays the file in the system default browser.
493
Version 7.0.1 (R14SP1) MATLAB® Software
Keyboard Access Added for More Desktop Tools
Additional desktop tools provide keyboard access to toolbar buttons and fields
via mnemonics. For example, Alt+K moves the cursor to the Stack field in
the Editor/Debugger toolbar. In the Profiler, the R in the Run this code
toolbar field is underlined, indicating that Alt+R moves the cursor to this
field. You might need to hold down the Alt key while the tool is selected in
order to see the mnemonics on the menus and buttons.
Macintosh Menus
On the Apple Macintosh platform, the location of menus in MATLAB has
changed. In this version, menus in MATLAB are not located at the top of the
screen with other screen menus for the Macintosh environment. Instead,
MATLAB menus appear within the MATLAB desktop and MATLAB tools.
This change was made because of a problem with screen menus that caused
MATLAB on the Macintosh platform to crash.
Running Functions — Command Window and
Command History
Preferences for Parentheses Matching Added
There are now Command Window preferences you can set to perform
parenthesis matching. Select File > Preferences > Command
Window > Keyboard and Indenting to set them. With the preference
Match parentheses while typing selected, when you type a parenthesis
or another delimiter, MATLAB highlights the matched parenthesis or other
delimiter in the pair. With the preference Match parentheses on arrow
key or mouse movement selected, when you move over a parenthesis
or another delimiter, MATLAB highlights the matched parenthesis or
other delimiter in the pair. MATLAB also alerts you to mismatches. These
preferences also allow you to specify how MATLAB notifies you of matches
and mismatches.
Clear Command Window Now Available from Context Menu
You can now select Clear Command Window from the context menu in
the Command Window. A confirmation dialog box does not appear and the
Command Window clears immediately. If you want a confirmation dialog box
494
Desktop Tools and Development Environment, MATLAB® Version 7.0.1 (R14SP1)
to appear before the Command Window clears, use Edit > Clear Command
Window instead.
End Key Behavior Changes
With the Display preference for Wrap lines selected, pressing End moves
the cursor to the end of the current statement. When the Command line
key bindings preference is set to Emacs (MATLAB standard), you can
also do this using Ctrl+E. In the previous version, End (and Ctrl+E) moved
the cursor to the end of the current line.
Help
Own Help Files Now Allow Special Icons
When you supply your own help files, you can now specify the type of icon that
appears in the Help browser Contents pane via the <help_contents_icon>
tag in the info.xml file. For details, see “Summary of Workflow for Providing
HTML Help Files”.
Workspace, Search Path, and File Operations
Array Editor: F2 Keyboard Shortcut Added to Edit Current
Element
A keyboard shortcut to use instead of double-clicking a cell is F2 (or Ctrl+U
on the Macintosh platform), which allows you to edit the current element,
positioning the cursor at the end of the element.
Array Editor: Single Quotation Marks Now Supplied for
Strings During Paste from Excel
When you copy data from the Microsoft® Excel® application and paste it into a
cell array in the Array Editor using the menu item Edit > Paste Excel Data,
MATLAB assumes the values are strings and automatically supplies the
single quotation marks if they cannot be interpreted as numeric values.
495
Version 7.0.1 (R14SP1) MATLAB® Software
Current Directory Browser Comments Now Include First Line
When you select the Current Directory preference Show M-file comments
and MAT-file contents, the help shown now includes the first comment
line (also called the H1 line).
Current Directory Browser Auto-Refresh Rate Now Specifiable
The Current Directory browser preference for auto-refresh now allows you to
specify the update time. By default, every 2 seconds the Current Directory
browser checks for and reflects any changes you made to files and directories
in the current directory using other applications.
In some cases when the current directory is on a network and the Current
Directory browser is open, MATLAB becomes slow because of the auto-refresh
feature. If you experience general slowness in MATLAB and have the
Current Directory browser open, increase the default update time to improve
responsiveness. If increases do not alleviate the slowness enough, clear the
check box in preferences to turn auto-refresh off. Then you can manually
refresh the display selecting Refresh from the context menu in the Current
Directory browser.
Find Files Field Now Uses Selected Text
You can now select text in the Command Window or Editor and the Find
Files dialog box enters that text in its Find files containing text field.
Editing and Debugging M-Files
Breakpoints Supported in Anonymous Functions
The Editor/Debugger supports breakpoints in anonymous functions. Lines
containing anonymous functions can have more than one breakpoint in a line:
one for the start of the line and one for each anonymous function in the line. A
line that contains multiple breakpoints has a blue breakpoint icon.
dbstatus Supports Anonymous and Nested Functions
The dbstatus function now supports anonymous and nested
functions, including a new '-completenames' argument. Running
dbstatus('-completenames') displays, for each breakpoint, the absolute
496
Desktop Tools and Development Environment, MATLAB® Version 7.0.1 (R14SP1)
filename and the sequence of functions that nest the function containing
the breakpoint.
Colors Now Maintained when Copying From Editor
When you paste a selection from the Editor into another application, such as
Word, the Editor now maintains the syntax highlighting colors in the file
in the other application. MATLAB pastes the selection to the clipboard in
RTF format, which many applications for Windows and Macintosh platforms
support.
Open Selection Now Works for Current Cursor Position
In an M-file, position the cursor within a subfunction, function, file, variable,
or Simulink model, and press Ctrl+D (or right-click and select Open
Selection). The item opens in the appropriate tool. In the previous version of
MATLAB, you had to select the complete name in the M-file to use this feature.
See “Opening a File or Variable from Within a File” for more information.
Source Control Interface
verctrl Function Does Not Support Handle
The verctrl function, available for Windows platforms only, was documented
incorrectly. The documentation stated that you could create a handle, and
showed the handle argument in the function syntax. You cannot create a
handle, but must instead use a value of 0 for that field.
Publishing Results
Notebook Causes MATLAB to Become Automation Server
If you run Notebook from MATLAB and MATLAB is not an automation server,
MATLAB will become an automation server. This is a change from Release 14,
where MATLAB spawned a second instance that was an automation server.
Notebook Now Supports Office 2003
Notebook now supports Office 2003 (for XP); it is one of the notebook -setup
options.
497
Version 7.0.1 (R14SP1) MATLAB® Software
Notebook Support for Word 97 to Be Discontinued
The Microsoft Word 97 application is supported in this release, but will not be
supported in future releases.
Compatibility Considerations. If you use Word 97 with Notebook, move to
a newer version of Word before moving to the next version of MATLAB.
498
Mathematics, MATLAB Version 7.0.1 (R14SP1)
Mathematics, MATLAB Version 7.0.1 (R14SP1)
This version introduces the following new features and changes:
• “New Function — ordeig” on page 499
• “More Functions Accept Single-Precision Data Inputs” on page 499
• “New Vendor BLAS Used for Linear Algebra in MATLAB” on page 500
• “Overriding the Default BLAS Library on Sun/Solaris Systems” on page 500
• “FDLIBM Version Upgraded” on page 501
• “Different Results When Solving Singular Linear Systems on Intel
Systems; Inconsistent NaN Propagation” on page 501
• “funm Returns Status Information; New Output Might Result In Error”
on page 502
New Function — ordeig
The new function ordeig takes a quasitriangular matrix T or matrix pair
(A,B) and returns the vector of eigenvalues in the same order that they
appear down the diagonal of T or (A,B). You can use ordeig with the
functions ordschur and ordqz, which reorder the eigenvalues of a Schur
factorization or a QZ factorization, respectively.
More Functions Accept Single-Precision Data Inputs
More MATLAB functions now accept single-precision data inputs in addition
to the usual double-precision inputs. To determine whether a function works
on single precision inputs, look for the Class support line in the M-file help
for the function. For example, to determine whether the function mean accepts
single-precision inputs, type
help mean
The Class support line is
float: double, single
which tells you that mean does accept single-precision inputs.
499
Version 7.0.1 (R14SP1) MATLAB® Software
New Vendor BLAS Used for Linear Algebra in MATLAB
MATLAB uses Basic Linear Algebra Subprograms (BLAS) for its vector inner
product, matrix-vector product, matrix-matrix product, and triangular solvers
in \. MATLAB also uses BLAS behind its core numerical linear algebra
routines from Linear Algebra Package (LAPACK), which are used in functions
like chol, lu, qr, and within the linear system solver \.
On some platforms, MATLAB continues to use ATLAS BLAS.
Starting in Release 14, MATLAB 7.0 uses vendor BLAS from the vecLib
library on the Mac.
Starting in Release 14 with Service Pack 1, MATLAB 7.0.1 uses vendor
BLAS from
• The Intel Math Kernel Library (MKL) Version 7.0 on Intel chips running
both Windows and Linux. See the MATLAB 7.0 Release Notes for how to
use the multi-threaded capabilities of MKL.
• The AMD Core Math Library (ACML) Version 2.0 library on AMD chips,
native 64 bit application
Overriding the Default BLAS Library on Sun/Solaris
Systems
MATLAB uses the Basic Linear Algebra Subroutines (BLAS) libraries to
speed up matrix multiplication and LAPACK-based functions like eig, svd,
and \ (mldivide). At start-up, MATLAB selects the BLAS library to use.
For Release 14 with Service Pack 1, MATLAB still uses the ATLAS BLAS
libraries on the Sun Microsystems Solaris Operating System. However, you
can switch the BLAS library that MATLAB uses to the Sun Performance
Library (Sunperf) BLAS, provided by Sun Microsystems.
If you want to take advantage of the potential performance enhancements
provided by the Sun BLAS, you can set the value of the environment variable
BLAS_VERSION to the name of the Sun Performance Library, libsunperf.so.4.
MATLAB uses the BLAS specified by this environment variable, if it exists.
500
Mathematics, MATLAB Version 7.0.1 (R14SP1)
To set the BLAS_VERSION environment variable, enter the following
command at the at the UNIX prompt.
% setenv BLAS_VERSION libsunperf.so.4
Then start MATLAB as usual.
To get visual feedback that the BLAS version has changed, also type at the
UNIX prompt
% setenv LAPACK_VERBOSITY 1
before starting MATLAB. This will display diagnostic information while
MATLAB is starting up, for example:
cpu_id: sun4u
libmwlapack: loading libsunperf.so.4
libmwlapack: loading lapack.so
FDLIBM Version Upgraded
In Release 14, MATLAB used FDLIBM Version 5.2. In R14SP1, MATLAB
has been upgraded to use FDLIBM Version 5.3.
Different Results When Solving Singular Linear
Systems on Intel Systems; Inconsistent NaN
Propagation
In previous releases, when you solved n-by-n linear systems Ax=b using
x = A\b, where A is singular or contains NaN, the computed result x often
contained NaN. In Version 7.0.1, the same command might return 0 in x, due
to the way the Intel Math Kernel Library (MKL) implementation of the BLAS
handles this operation.
Compatibility Considerations
Code that relies on the result containing NaN should check for the following
warnings instead:
• For singular A, an existing warning is issued.
x = [1 2; 0 0]\[1; 0]
501
Version 7.0.1 (R14SP1) MATLAB® Software
Warning: Matrix is singular to working precision.
x =
1
0
• For A that contains NaN, a new warning message is issued.
x = [1 2; 0 NaN]\[1; 0]
Warning: Matrix is singular, close to singular or badly scaled.
Results may be inaccurate. RCOND = NaN.
x =
1
0
funm Returns Status Information; New Output Might
Result In Error
Prior to Release 14, the second output of the function funm was an error
estimate that was sometimes inaccurate. In Release 14, Version 7.0, the
second output was replaced by an exit flag that indicates whether the
computation was successful.
Compatibility Considerations
Code that was created prior to Release 14 and that uses the second output of
funm, might not work correctly in Version 7.0 or later.
502
Programming, MATLAB Version 7.0.1 (R14SP1)
Programming, MATLAB Version 7.0.1 (R14SP1)
This version introduces the following new features and changes:
• “Character Set Conversion Functions Added” on page 503
• “datevec Support of Empty String Argument” on page 504
• “depfun Function Supports New Options” on page 504
• “ftell Returning Invalid Position in Rare Cases” on page 504
• “fwrite Saves uint64 and int64 Types” on page 505
• “mat2str Enhanced to Work with Non-double Types” on page 505
• “nargin, nargout Operate on Function Handles” on page 505
• “regexprep Now Supports Character Representations in Replacement
String” on page 506
• “Logical OR Operator | in regexp Expressions Might Yield Different
Results from Previous Version” on page 506
• “Multiple Declarations of Persistent Variables No Longer Supported” on
page 507
• “Function Declaration Compatibililty with Pre-R14 M-Files” on page 508
Character Set Conversion Functions Added
Unicode is becoming the preferred internal presentation of characters in
MATLAB. For example, MATLAB functions such as disp require an input
string in Unicode to display properly. To facilitate the use of different
character sets, MATLAB provides two new functions to convert characters
from a native character set to Unicode and back.
The native2unicode function converts from either a default, or user specified,
native character set to Unicode. The unicode2native function does the
opposite, converting from Unicode to either a default, or user specified, native
character set. Note that any MATLAB string containing only US-ASCII
characters does not require any conversion.
Type doc native2unicode or doc unicode2native for more information on
these functions.
503
Version 7.0.1 (R14SP1) MATLAB® Software
datevec Support of Empty String Argument
For the purpose of backwards compatibility, invoking the command
datevec('') now returns an empty vector.
Compatibility Considerations
This behavior was not intentional in previous versions of MATLAB, and it is
subject to change in future releases.
depfun Function Supports New Options
The depfun function now supports these options:
Option
Description
'-all'
Computes all possible left-side arguments and
displays the results in the report(s). Only the
specified arguments are returned.
'-calltree'
Returns a call list in place of a called_from
list. This is derived from the called_from list
as an extra step.
'-expand'
Includes both indices and full paths in the call
or called_from list.
'-print', 'file'
Prints a full report to file.
'-quiet'
Displays only error and warning messages, and
not a summary report.
'-toponly'
Examines only the files listed explicitly as input
arguments. It does not examine the files on
which they depend.
'-verbose'
Outputs additional internal messages.
ftell Returning Invalid Position in Rare Cases
The ftell function is likely to return an invalid position when all of the
following are true. This is due to the way in which the Microsoft Windows C
library currently handles its ftell and fgeptos commands:
504
Programming, MATLAB Version 7.0.1 (R14SP1)
• The file you are currently operating on is an ASCII text file.
• The file was written on a UNIX-based system, or uses the UNIX-style line
terminator: a line feed (with no carriage return) at the end of each line of
text. (This is the default output format for MATLAB functions dlmwrite
and csvwrite.)
• You are reading the file on a Windows system.
• You opened the file with the fopen function with mode set to 'rt'.
• The ftell command is directly preceded by an fgets command.
Note that this does not affect the ability to accurately read from and write to
this type of file from MATLAB.
Compatibility Considerations
This represents a change in behavior.
fwrite Saves uint64 and int64 Types
The fwrite function can now save uint64 and int64 values. Previously
fwrite supported these data types only on DEC Alpha systems. Now, it works
on all supported MATLAB platforms.
mat2str Enhanced to Work with Non-double Types
In MATLAB 7.0.1, you can use the mat2str function to convert nondouble
data types to a string that represents the input value. Type doc mat2str
for more information.
nargin, nargout Operate on Function Handles
The nargin and nargout functions now accept a either a function name or
function handle as an input argument. When called with a function handle,
nargin and nargout return the number of input or output arguments you can
pass to or receive from the function that the handle maps to.
505
Version 7.0.1 (R14SP1) MATLAB® Software
regexprep Now Supports Character Representations
in Replacement String
The regexprep function now supports the use of character representations
(e.g., '\t' for tab, '\n' for newline) in replacement strings. For example, the
following regexprep command replaces the | character with two horizontal
tabs:
str = 'Field 1 | Field 2 | Field 3';
regexprep(str, '\|', '\t\t')
ans =
Field 1
Field 2
Field 3
In Version 6, the same command yielded the string
Field 1 \t\t Field 2 \t\t Field 3
Logical OR Operator | in regexp Expressions Might
Yield Different Results from Previous Version
Be careful about using the logical OR (|) operator within square brackets (e.g.,
[A|B]) in regular expressions in MATLAB. The recommended way to match
“the letter A or the letter B” in a MATLAB regexp expression is to use '[AB]'.
Compatibility Considerations
If you have used '[A|B]' for this purpose in earlier versions of MATLAB, you
may get unexpected results when you run your code in version 7.0.
MATLAB versions 6.0 and 6.5 treat | as an ordinary character when it is
used between square brackets. For example, these versions interpret the
expression '[A|B]' as “match 'A', or match '|', or match 'B'.” MATLAB 7.0
correctly gives precedence to the logical OR functionality of the | operator.
Because of this change, MATLAB now interprets '[A|B]' as “match '[A',
or match 'B]'.”
You can avoid the effects of this bug fix altogether by using the recommended
syntax '[AB]' for this type of operation. This syntax returns the correct
results in all MATLAB versions.
The following example attempts to find the word Jill or Bill in the string ’My
name is Bill’. The syntax used in the expression is incorrect, but regexp in
506
Programming, MATLAB Version 7.0.1 (R14SP1)
MATLAB 6.5 finds a match anyway because of the software bug. This syntax
does not work in version 7.0 or 7.0.1 because MATLAB now interprets the
expression as the logical OR of the two statements, '[J' and 'B]ill':
MATLAB 6.5
str = 'My name is Bill';
expr = '[J|B]ill';
[s e] = regexp(str, expr);
str(s:e)
ans =
Bill
MATLAB 7.0.1
str = 'My name is Bill';
expr = '[J|B]ill';
[s e] = regexp(str, expr);
str(s:e)
ans =
Empty string: 1-by-0
Using the recommended syntax returns the correct results in all MATLAB
versions:
str = 'My name is Bill';
expr = '[JB]ill';
[s e] = regexp(str, expr);
str(s:e)
ans =
Bill
If you want to use | in an expression as an ordinary character, precede it
with a backslash:
str = 'The | operator performs a logical OR';
expr = 'The [\$ \| \#] operator';
[s e] = regexp(str, expr);
str(s:e)
ans =
The | operator
Multiple Declarations of Persistent Variables No
Longer Supported
You can no longer declare a variable as persistent more than once within a
function.
Compatibility Considerations
If you do this, you will need to modify your code.
507
Version 7.0.1 (R14SP1) MATLAB® Software
Function Declaration Compatibililty with Pre-R14
M-Files
As of Release 14, the function definition line in a function M-file no longer
requires commas separating output variables. However, because this syntax
is not compatible with earlier releases, you should always include the comma
separators when writing an M-file function that you intend to run on releases
both earlier and later than Release 14.
Compatibility Considerations
See “Comma Separators Not Required in Function Declaration” on page 593
in the Release 14 release notes.
508
Graphics, MATLAB® Version 7.0.1 (R14SP1)
Graphics, MATLAB Version 7.0.1 (R14SP1)
This version introduces the following new feature:
OpenGL Trouble Shooting
The opengl command now enables you to switch from hardware to
software-based OpenGL® rendering. It also enables you to select various
known bug workarounds. See the opengl reference page for more information.
Compatibility Considerations
Cannot Dock Figures on Macintosh Systems
You cannot dock figures in the Desktop, because MATLAB uses native figure
windows on the Macintosh platform.
Plotting Tools Not Working on Macintosh Systems
The plotting tools are not supported on the Macintosh platform. This
means the Figure Palette, Plot Browser, and Property Editor do not work
these platforms. To use the MATLAB 6 Property Editor, see the propedit
command.
Not All Macintosh System Fonts Are Available
MATLAB figures do not support the same fonts as native Macintosh
applications. Use the uisetfont functions to see which fonts are available
in MATLAB.
Preview Java Figures on the Macintosh Platform
You can preview the use of Java Figure on the Mac by starting MATLAB
with the -useJavaFigures option.
509
Version 7.0.1 (R14SP1) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7.0.1 (R14SP1)
This version introduces the following new features and changes:
• “FIG-File Format Change” on page 510
• “Panels, Button Groups, and ActiveX Components” on page 510
• “Comments Now Optional for Newly Generated Callback Functions” on
page 511
• “Windows XP Display of Push and Toggle Buttons” on page 511
FIG-File Format Change
GUI FIG-files that are created or modified with MATLAB 7.0 or a later
MATLAB version are not automatically compatible with Version 6.5 and
earlier versions.
• GUIs Saved from GUIDE or from the Command Line: You can check the
Ensure backward compatibility (-v6) preference in the Preferences
dialog box under General > MAT-Files. When this preference is checked,
all MAT-files are saved so as to be backward compatible with Version 6.5
and earlier versions.
• Alternative for GUIs Saved from the Command Line: If you do not want
to check the MAT-Files preference described above, but want to make
individual GUI FIG-files backward compatible, use the 'v6' argument
when you save the GUI with the hgsave function.
Compatibility Considerations
To make FIG-files, which are a kind of MAT-file, backward compatible, you
must explicitly specify that you want the backwards compatibility.
Panels, Button Groups, and ActiveX Components
Panels, button groups, and ActiveX components were introduced in
MATLAB 7.0. These components are not compatible with versions earlier
than 7.0.
510
Creating Graphical User Interfaces (GUIs), MATLAB Version 7.0.1 (R14SP1)
Compatibility Considerations
You should not use these components in GUIs that you expect to run in
earlier MATLAB versions.
You can export a GUI that contains a panel, button group, or ActiveX
component from GUIDE to a single M-file that does not require a FIG-file.
However, you will not be able to run that M-file in MATLAB versions earlier
than 7.0.
Comments Now Optional for Newly Generated
Callback Functions
In prior releases, GUIDE automatically generated comment lines for each
callback that you added to an existing GUI M-file. For example:
% --- Executes during object deletion, before destroying properties.
function figure1_DeleteFcn(hObject, eventdata, handles)
% hObject
handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
Comment lines are now optional for most callbacks. If you want the comments
to be generated automatically when you add a callback, check the new
preference Add comments for newly generated callback functions on
the GUIDE panel of the Preferences dialog box. The factory default is
checked.
If this preference is unchecked, GUIDE includes the comment lines only for
callbacks that are automatically included for the GUIDE template you chose.
No comments are included for any other callbacks that are added to the M-file.
Windows XP Display of Push and Toggle Buttons
Push buttons and toggle buttons with background colors other than the
default display differently in Windows XP.
Compatibility Considerations
For Windows XP, GUI push buttons are displayed with a white background.
If you have specified a background color other than the default, that color
511
Version 7.0.1 (R14SP1) MATLAB® Software
appears as a border around the push button. Unselected toggle buttons are
displayed with the specified background color, but selected toggle buttons are
displayed with a white background bordered by the background color.
512
External Interfaces/API, MATLAB® Version 7.0.1 (R14SP1)
External Interfaces/API, MATLAB Version 7.0.1 (R14SP1)
New features and changes introduced in this version are described here.
Function Handles in COM Event Callbacks
MATLAB software now supports function handles as callbacks for Microsoft
ActiveX objects. This example passes a function handle that maps to sampev
to registerevent:
cd $matlabroot\toolbox\matlab\winfun
h = actxcontrol('mwsamp.mwsampctrl.2', [0 0 200 200]);
registerevent(h, @sampev);
% Click the control.
Registering Events for COM Servers and Controls
With MATLAB 7.0.1, you can register events for COM servers as well as
for COM controls.
Expanded Support for Web Services (SOAP and
WSDL)
This version expands MATLAB support for Web services, that is, Simple
Object Access Protocol (SOAP) and Web Services Description Language
(WSDL). These are some of the key enhancements:
• MATLAB now supports document style messages, in addition to the
Remote Procedure Call (RPC) style supported in version 7.0.
• MATLAB preserves the case in method, class, and object names.
• Web services functions now decode results that use Base64 encoding.
• The createClassFromWsdl function now supports WSDL files that define
multiple services.
Specifying the Search Path for Sun Java Native
Method DLLs
The mechanism that MATLAB uses to locate native method libraries that are
required by Java has changed. MATLAB no longer uses system environment
variables to define the paths to these libraries.
513
Version 7.0.1 (R14SP1) MATLAB® Software
Compatibility Considerations
If you presently rely on the PATH (for Windows) or LD_LIBRARY_PATH (for
UNIX) environment variables for this purpose, you will need to use the file
librarypath.txt, as described below, in its place.
Specifying the Java Library Path
Java classes can dynamically load native methods using the Java method
java.lang.System.loadLibrary("LibFile"). In order for the JVM software
to locate the specified library file, the directory containing it must be on the
Java Library Path. This path is established when MATLAB launches the
JVM software at startup, and is based on the contents of the file
$matlab/toolbox/local/librarypath.txt
(where $matlab is the MATLAB root directory represented by the MATLAB
keyword matlabroot).
You can augment the search path for native method libraries by editing the
librarypath.txt file. Follow these guidelines when editing this file:
• Specify each new directory on a line by itself.
• Specify only the directory names, not the names of the DLL files. The
LoadLibrary call does this for you.
• To simplify the specification of directories in cross-platform environments,
you can use any of these macros: $matlabroot, $arch, and $jre_home.
MATLAB DDE Server Is Now Disabled By Default
To enable the DDE server start MATLAB with the /Automation option.
The outgoing MATLAB DDE commands (ddeinit,
ddeterm, ddeexec, ddereq, ddeadv, ddeunadv, ddepoke)
function normally without the MATLAB DDE server. See
http://www.mathworks.com/support/solutions/data/1-Q4728.html?
solution=1-Q4728 for more information.
514
External Interfaces/API, MATLAB® Version 7.0.1 (R14SP1)
Clearing MEX-Functions
The command clear mex now clears MEX-functions, but not MATLAB
scripts. Entering clear mex does not clear locked functions or functions
that are currently in use. It does however clear breakpoints and persistent
variables.
515
Version 7 (R14) MATLAB
Software
This table summarizes what’s new in Version 7 (R14):
New Features
and Changes
Version
Compatibility
Considerations
Fixed Bugs
and Known
Problems
Related
Documentation
at Web Site
Yes
Details below
Yes — Details
labeled as
Compatibility
Considerations
in descriptions
of new features
and changes. See
also Summary.
Fixed bugs
No
New features and changes introduced in this version are organized by these
areas:
• “Desktop Tools and Development Environment, MATLAB Version 7 (R14)”
on page 519
• “Mathematics, MATLAB Version 7 (R14)” on page 548
• “Programming, MATLAB Version 7 (R14)” on page 573
• “Graphics and 3-D Visualization, MATLAB Version 7 (R14)” on page 613
• “Creating Graphical User Interfaces (GUIs), MATLAB Version 7 (R14)”
on page 622
517
Version 7 (R14) MATLAB® Software
• “External Interfaces/API, MATLAB Version 7 (R14)” on page 628
518
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Desktop Tools and Development Environment, MATLAB
Version 7 (R14)
New features and changes introduced in this version are organized by these
topics:
• “Startup and Shutdown” on page 519
• “Desktop” on page 520
• “Running Functions — Command Window and Command History” on page
524
• “Help” on page 528
• “Workspace, Search Path, and File Operations” on page 531
• “Editing and Debugging M-Files” on page 536
• “Tuning and Managing M-Files” on page 542
• “Source Control Changes” on page 546
• “Publishing Results” on page 546
Startup and Shutdown
Version of JVM Software Updated
MATLAB software is now using version 1.4.2 of Sun Microsystems Java JVM
software.
519
Version 7 (R14) MATLAB® Software
Desktop
New features and changes introduced in this version are
• “Arranging Documents Supports New Options” on page 520
• “Finding Files and Content in Files with New Tools” on page 521
• “MATLAB Shortcuts—Use to Easily Run Group of Statements” on page 521
• “MATLAB Web Browser Added” on page 522
• “Menu Changes” on page 522
• “Keyboard Shortcuts Added to Go to Tools and Documents” on page 522
• “Drag and Drop Supported Between Desktop Tools” on page 522
• “Arranging Columns in Tools” on page 523
• “Font and Color Preferences for Tools” on page 523
• “terminal Function Removed” on page 523
• “license Function Results Modified Slightly” on page 524
Arranging Documents Supports New Options
The MATLAB desktop now provides you with new options for arranging the
following types of documents:
• M-files and other files in the Editor/Debugger
• Arrays in the Array Editor
• Figure windows
• HTML documents in the MATLAB Web browser
You can dock these types of documents in the desktop, undock them from the
desktop so each is in its own separate window, or group undocked documents
together in their tool. You can now position the documents using these
features: tile, left/right split, top/bottom split, floating, or maximized. Use the
Window menu or toolbar icons to position documents.
520
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Docking Tools and Documents. There are now dock buttons
in the
menu bars of undocked tools and documents. Click a dock button to move the
tool into the desktop, or to move the document into its tool.
Document Bar. There is now a Document Bar in tools that support
documents that you use to go to open documents. It appears when there is
more than one maximized document open in a tool. You can hide or move the
Document Bar by selecting Desktop > Document Bar menu options.
Saving Layouts. You can save desktop layouts. Select Desktop > Save
Layout and provide a name. To restore a saved layout, select
Desktop > Desktop Layout > name.
Launch Pad Removed. The Launch Pad tool was removed. Use the Start
button instead.
Adding Your Own Toolbox to Start Button. Add your own toolbox to the
Start button. Select Start > Desktop Tools > View Source Files. Click
Help in the resulting dialog box for details.
Finding Files and Content in Files with New Tools
Search for files and directories, as well as for content within files by selecting
Edit > Find Files from any desktop tool. For details, see “Advanced Search
for Files — Find Files Tool” in the online documentation.
MATLAB Shortcuts—Use to Easily Run Group of Statements
You can create and run MATLAB shortcuts, where a shortcut is an easy way
to run a group of MATLAB statements. A shortcut is like an M-file script, but
unlike an M-file, a shortcut does not have to be on the search path or in the
current directory for MATLAB when you run it.
Create a shortcut by selecting Start > Shortcuts > New Shortcut and
completing the dialog box. Run the shortcut from the Start button.
You can also create a shortcut by dragging selected statements to the shortcut
toolbar. This adds the shortcut to the toolbar, from where you can then run it.
For details, see “Running Frequently Used Statement Groups with MATLAB
Shortcuts” in the online documentation.
521
Version 7 (R14) MATLAB® Software
MATLAB Web Browser Added
MATLAB now displays HTML documents it produces in a new desktop tool,
the MATLAB Web browser. You can display HTML documents in this Web
browser using the web function.
The web function now opens the MATLAB Web browser by default, instead of
opening the MATLAB Help browser. Use the web function’s -helpbrowser
option to display files in the Help browser.
Menu Changes
Debug Menu Added. You can now access debugging features from the
Debug menu of most desktop tools.
View, Window, and Desktop Menus. There is no longer a desktop View
menu, although some tools still have a View menu. The Window menu in
the desktop has changed. Use the new Desktop menu to select a layout,
and to open and close tools. Use the Window menu to access open tools and
documents, as well as to position documents. The menus and the menu items
in the desktop change, depending on the current tool selected.
Web Menu Items Moved. The Web menu was removed. Access the items
it contained from Help > Web Resources.
Keyboard Shortcuts Added to Go to Tools and Documents
There is now a keyboard shortcut you can use to go to each tool and to each
open document. For example, use Ctrl+0 to go to the Command Window,
and Ctrl+Shift+0 to go to the most recently used Editor document. See the
Window menu for the shortcuts to go to currently open tools and documents.
There have been some changes to the keyboard shortcuts you use with desktop
tools. For example, Ctrl+Tab now moves you to the next open tool or group of
tools tabbed together. In previous releases, Ctrl+Tab moved you to the next
open document or tool. In MATLAB version 7, use Ctrl+Page Down to move
to the next open document or tool in a tabbed group.
Drag and Drop Supported Between Desktop Tools
You can drag selected text or files between desktop tools. For example, you can
522
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
• Select text in the Editor and drag it to the Command Window, which cuts
and pastes it into the Command Window. You can use Ctrl while dragging
to copy selected text instead of just moving it.
• Select a file in the Current Directory browser and drag it to the Editor,
which opens the file in the Editor.
You can also drag selected text or files between desktop tools and external
tools and applications. For example, you can
• Select a MAT-file from the Microsoft Windows Explorer and drag it to the
Command Window, which loads the data into the workspace for MATLAB.
• Select text from a page displayed in a Netscape Navigator browser and drag
it to a file in the Editor, which pastes the text into the file in the Editor.
Arranging Columns in Tools
In desktop tools that contain columns, you can drag a column to a new
position. For example, this includes the Current Directory browser, and the
Help browser Index and Search panes. Click a column head to sort by that
column. For some tools, you can click again to reverse the sort order.
When a column is too narrow to show all the information in it, position the
cursor over a long item in that column, and a tooltip displays showing the
complete content of the item.
Font and Color Preferences for Tools
Access font and color preferences for all desktop tools in the Fonts
and Colors preference panes. Select File > Preferences > Fonts or
File > Preferences > Colors. For more information, click the Help button
in the preferences dialog box, or see “Setting Fonts Preferences for Desktop
Tools” and “Setting Colors Preferences” in the online documentation.
terminal Function Removed
The terminal function was removed.
Compatibility Considerations. If your code refers to the terminal function,
you need to change it.
523
Version 7 (R14) MATLAB® Software
license Function Results Modified Slightly
The data returned by the license command is now sorted in alphabetical
order and uses only lowercase characters.
Compatibility Considerations. If you rely on the data returned by license,
be sure your code works properly with these changes.
Running Functions — Command Window and
Command History
New features and changes introduced in this version are
• “Tab Completion Graphical Interface Added; Removed Preference to Limit
Completions” on page 524
• “Navigate in Command Window Using Arrow Keys Via New Preference”
on page 525
• “Incremental Search Indicates Search Direction and is Now Case Sensitive”
on page 525
• “commandwindow Function Added to Open or Select the Command
Window” on page 525
• “Macintosh Platforms: Command +. Now Stops Execution” on page 525
• “Comment After Ellipsis Now Properly Highlighted” on page 525
• “Evaluate Selection from Context Menus No Longer Appends” on page 526
• “Syntax Highlighting Default Colors Modified” on page 526
• “Ctrl+C to Stop Execution is Now More Consistent” on page 526
• “Parentheses Matching Support Removed” on page 526
• “Command History Features” on page 527
Tab Completion Graphical Interface Added; Removed
Preference to Limit Completions
Tab completion now has a graphical interface. For example, type cos
and press the Tab key. A list of functions that begin with cos appears.
Double-click the function you want and MATLAB completes the name in the
Command Window. Alternatively, when the list of names appears, you can
524
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
type the next unique letter in the name, and the first name in the list that
matches it is selected. Continue typing unique letters to select the name you
want, and press Enter. Press Esc to clear the list without selecting a name.
With the new interface, there is a no longer a preference allowing you to limit
the number of tab completions that display. MATLAB always displays all
possible completion.
Compatibility Considerations. If you relied on the preference to limit the
number of tab completions MATLAB displays, type more characters before
pressing Tab so fewer possible completions display.
Navigate in Command Window Using Arrow Keys Via New
Preference
There is a new preference that allows you to use arrow keys to navigate in
the Command Window instead of recalling history.
Incremental Search Indicates Search Direction and is Now
Case Sensitive
The incremental search interface now indicates the search direction. It is also
case sensitive when you enter uppercase letters in the search field.
commandwindow Function Added to Open or Select the
Command Window
Use the new commandwindow function to open the Command Window when
it is closed. For example, use this function in an M-file. Or if the Command
Window is already open, use the function to select the Command Window,
making it the active window.
Macintosh Platforms: Command +. Now Stops Execution
On Apple Macintosh platforms, you can now use Command+. (Command
key and period key) to stop execution of a running program.
Comment After Ellipsis Now Properly Highlighted
When you include an ellipsis in a statement so that you can continue the
statement on the next line, any text you type after the ... on the same line is
525
Version 7 (R14) MATLAB® Software
considered to be a comment in MATLAB and now is syntax highlighted as
a comment. In previous releases, the syntax highlighting did not indicate
the text after the ... as a comment.
Evaluate Selection from Context Menus No Longer Appends
Evaluate selection, available from context menus for various tools, no longer
appends the selection to the statement at the prompt, but instead runs
the selection. Make a selection and press Enter or Return to append the
selection to the statement at the prompt and execute it.
Syntax Highlighting Default Colors Modified
The default colors for syntax highlighting have been modified. Unterminated
strings are now maroon, while terminated strings are now purple. This
is the opposite of previous versions. Maroon is considered to be more of an
“alerting” color, resembling the default of red for errors, which is the reason
for the change. If you prefer the colors used in previous versions, change
them using preferences — see “MATLAB Syntax Highlighting Colors” in the
online documentation.
In addition, arguments in statements entered using command syntax rather
than function syntax are highlighted as strings, emphasizing that variables in
command syntax are passed as literal strings rather than as their values.
Ctrl+C to Stop Execution is Now More Consistent
Stopping execution using Ctrl+C (^C) has changed. Windows and The Open
Group UNIX platforms now respond similarly to Ctrl+C, and in general,
stop execution without the need for pause or drawnow statements in your
M-files. For M-files that run for a long time, or that call built-ins or MEX-files
that take a long time, Ctrl+C does not always effectively stop execution. In
that event, include a drawnow command in your M-file, for example, within
a large loop. Ctrl+C might be less responsive if you started MATLAB with
the -nodesktop option.
Parentheses Matching Support Removed
Matching parentheses in the Command Window is not supported in this
version.
526
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Compatibility Considerations. This feature was available in the Command
Window in previous versions but you cannot use it in this version.
Command History Features
Syntax Highlighting in Command History. Entries in the Command
History tool now appear with syntax highlighting.
Tree View in Command History. Entries in the Command History now
appear in a tree view so you can minimize the length of the visible history.
The top-level nodes of the tree are the dates/times for each session, and
beneath that is the history for that session. Click the - to the left of a
date/time to hide the history entries for that session. Click the + to the left of
a date/time entry to show history entries for that session.
commandhistory Function Added to Go to Tool. Use the new
commandhistory function to open the Command History when it is closed, and
to select it when it is open.
Save Frequency Higher by Default. The default for saving the history
has changed. Now, by default, MATLAB saves the history file after five
statements have been added to the history. You can modify the frequency
using Command History preferences.
527
Version 7 (R14) MATLAB® Software
Help
New features and changes introduced in this version are
• “Documentation Now Automatically Installed; Not Accessible from
CD-ROMs and docroot Not Supported” on page 528
• “Index Pane Adds Alphabetical Links” on page 528
• “Search Type Removed” on page 529
• “Favorites in Help Browser” on page 529
• “Display Pane Find in Page Icon” on page 529
• “Title Field No Longer Supports Web Browsing” on page 529
• “docsearch Function Added to Execute Help Browser Search” on page 529
• “help Function Provides Help for Methods and Classes” on page 530
• “web Function Now Opens MATLAB Web Browser By Default” on page 530
• “HTML Documentation Not Viewable with -nojvm Startup Option” on page
530
Documentation Now Automatically Installed; Not Accessible
from CD-ROMs and docroot Not Supported
Documentation is automatically installed for all the products
you install. Documentation is no longer accessible from
CD-ROMs. To access the documentation for products
not installed on your system, use The MathWorks Web site,
http://www.mathworks.com/access/helpdesk/help/helpdesk.shtml.
Compatibility Considerations. Because of this change, the docroot
function is no longer needed and will not be supported.
Index Pane Adds Alphabetical Links
The Index pane now has an alphabetical quick index, so you can choose a
letter to see entries starting with that letter. You can still type any index term
in the text box to go directly to that term. Index entries are now shown as
links. Entries that are merely headings do not go to a specific page and do not
528
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
appear as links. As is true for all desktop tools, you can now drag columns in
the Index pane to reorder them, or click a column head to sort by that column.
Search Type Removed
In the Search pane, you no longer select the type of search. Results are
ordered so reference pages appear first, followed by headings that include the
search terms. After performing a search, click the link at the bottom of the
Search pane to look for the same term in the technical support database on
The MathWorks Web site. As is true for all desktop tools, you can now drag
columns in the Search pane to reorder them, or click a column head to sort
by that column.
Favorites in Help Browser
Add pages in the Help browser to favorites (also known as bookmarking
pages) by selecting Favorites > Add to Favorites. The Favorites Editor
dialog box opens. Accept the default entries or modify the Label and click
Save. Access favorites from the Favorites menu or from the Start menu
Shortcuts item.
Display Pane Find in Page Icon
Click the binoculars icon on the display pane toolbar to search within the page.
Title Field No Longer Supports Web Browsing
The Help browser is now used only for MathWorks documentation installed
with your products.
You can no longer enter a URL in the Title field of the display pane. Instead
run the web function to enter a URL in the Location field. Links from the
documentation to Web pages display the Web pages in the MATLAB Web
browser, not in the Help browser.
docsearch Function Added to Execute Help Browser Search
The new docsearch function allows you to execute a full text search of the
Help browser documentation from the Command Window.
529
Version 7 (R14) MATLAB® Software
help Function Provides Help for Methods and Classes
The help function now allows you to get help for methods and classes. For
details, see specific instructions in the release notes about using help and doc
for each product, or type help help.
web Function Now Opens MATLAB Web Browser By Default
The web function no longer opens the specified URL in the Help browser by
default, but instead opens the page in the MATLAB Web browser.
Compatibility Considerations. If you want web to open pages in the Help
browser, use the -helpbrowser option.
HTML Documentation Not Viewable with -nojvm Startup
Option
If you start MATLAB using the -nojvm option, you cannot view the HTML
documentation files from within MATLAB. The docopt function no longer
supports that option.
Compatibility Considerations. This represents a change from previous
versions. You can view the HTML documentation files at the MathWorks
Web site.
530
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Workspace, Search Path, and File Operations
New features and changes introduced in this version are organized by these
topics:
• “Workspace Browser Enhancements and Changes” on page 531
• “Array Editor Enhancements and Changes” on page 532
• “Built-In Functions Now Treated Like Other M-Files on Search Path” on
page 532
• “savepath Function Added to Replace path2rc” on page 533
• “Search Path Functions — Other Enhancements and Changes” on page 533
• “File Operations” on page 534
• “Current Directory Browser Changes and Enhancements” on page 535
• “Visual Directory and Directory Reports in Current Directory Browser”
on page 535
Workspace Browser Enhancements and Changes
Value Column Added to Workspace Browser. The Workspace browser
now includes a Value column where you can see the content of the variable,
or a description of the content. Click the value in the Value column to edit
the content.
Rename or Duplicate Variable in Workspace Browser. Click a variable
name (in the Name column) to rename the variable. To create a copy of a
variable, right-click and select Duplicate from the context menu.
Plotting Selected Variables from Workspace Browser. Click the plot
in the Workspace browser toolbar to plot the selected variable.
icon
Choose from other applicable plots by clicking the arrow next to the plot
button. The function used to create the plot appears in the Command Window
so you can use it again later.
Print from Workspace Browser. Click the Print button in the Workspace
browser toolbar to print a view of the current workspace.
531
Version 7 (R14) MATLAB® Software
MAT-Files Compressed by Default. MAT-files are now compressed by
default. For details on compressing MAT-files, see the “Compressed Data
Support in MAT-Files” on page 579 in the Programming release notes.
genvarname Function Added to Construct Variable Name in MATLAB
Software. Use the new function genvarname to construct a valid variable
name in MATLAB from a given candidate, where the candidate can be a
string or a cell array of strings. For details, type help genvarname.
datatipinfo Function Added to Display Information About Variable.
The new function datatipinfo(x) displays information about the variable, x.
Array Editor Enhancements and Changes
Cell Arrays and Structures Now Supported. You can now view and edit
the content of cell arrays and structures in the Array Editor. For example,
double-click a structure in the Workspace browser to open it in the Array
Editor. In the Array Editor, double-click an element of the structure to open it
as its own Array Editor document. You can then view and edit the contents.
Plotting Multiple Elements. You can select contiguous elements in an
array, and then click the plot button
on the Array Editor toolbar to
plot only the selected elements. Click the arrow next to the plot button in the
toolbar to select from other applicable plots.
Print from Array Editor. You can print an array from the Array Editor.
Select File > Print to create a print of the current variable.
Larger Arrays Supported. You can open arrays having up to 2^19 (524288)
elements, which is eight times more than the previous limit, 2^16 (65536).
Save to MAT-File. You can save a variable to a MAT-file from the Array
Editor. Select File > Save and complete the resulting Save dialog box.
Built-In Functions Now Treated Like Other M-Files on Search
Path
MATLAB now considers built-in files to be the same as other M-files on the
search path.
532
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Compatibility Considerations. MATLAB no longer considers built-in
functions differently from any other M-files on the search path. MATLAB
now looks for a given name first as a variable, then as an M-file in the current
directory, and finally as an M-file on the search path. Previously MATLAB
looked for a given name as a built-in function after looking for it as a variable.
If you have a function name that is the same as a MATLAB built-in function,
your function might run instead of the built-in function, whereas in previous
releases the built-in function would have run. For the built-in function to
run, remove or rename your function, or change the directory order in the
search path.
savepath Function Added to Replace path2rc
There is a new function, savepath, that saves the current search path to a
file, pathdef.m, so that you can use the same search path in future sessions.
Note that this function replaces path2rc.
Compatibility Considerations. The path2rc function has been replaced by
a new function, savepath. If you use path2rc, it will run savepath instead.
The new function, savepath, performs the same actions as path2rc did, but
uses a more intuitive name. In addition, savepath is case sensitive on PC
platforms, whereas path2rc was not. Use savepath instead of path2rc, and
replace existing instances of path2rc with savepath.
Search Path Functions — Other Enhancements and Changes
restoredefaultpath Function Added for Recover from Problems. There
is a new function, restoredefaultpath, that helps redefine the search path
file, pathdef.m, to include only files installed with MathWorks products. Use
this function to recover from problems with the path. If that fails, run
restoredefaultpath; matlabrc
genpath Function Now Includes Empty Directories. The genpath
function now includes empty directories in the generated path string.
which Function Now Shows Built-In Functions. The which function
now displays the pathname for built-in functions, as well as for overloaded
functions when only the overloaded functions are available
533
Version 7 (R14) MATLAB® Software
File Operations
Finding Files and Content Within Files. From any desktop tool, select
Edit > Find Files. Complete the resulting dialog box to find specified files or
files containing specified text in the directories you choose. Double-click a file
in the results listing to open it. For details, see “Advanced Search for Files
— Find Files Tool” in the online documentation.
Preventing Accidental File Deletion. Use the new recycle function or
the General preference for the delete function to send files you remove
using the delete function to the Recycle Bin on Windows platforms, to the
Trash Can on Macintosh platforms, or to a /tmp/MATLAB_Files_timestamp
directory on UNIX platforms. You can then recover any accidentally deleted
files from these locations.
534
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Current Directory Browser Changes and Enhancements
Source Control Interface Features Accessible from Current Directory
Browser. You can access source control system features from the Current
Directory browser. Right-click a file or directory, and from the context menu,
select Source Control and then select the source control function you want
to use.
Open File Using External Application. To open a file using an external
application, select Open Outside MATLAB from the context menu.
For example, if you select myfile.doc, Open Outside MATLAB opens
myfile.doc in the Microsoft Word application, assuming you have the .doc
file association configured to launch Word.
Copy and Paste Directories. Using the Current Directory browser, you can
now copy and paste directories, including the entries’ contents.
Drag to Reorder Columns. As is true for all desktop tools, you can drag
columns in the Current Directory browser to reorder them, or click a column
head to sort by that column. For an item that does not fit in its column, you
can hover over it to see the full name of the item.
Current Directory Text Field Does Not Display When Current Directory
Browser is Docked. The current directory field appears in the Current
Directory browser only when the Current Directory browser is undocked from
the MATLAB desktop. When the Current Directory browser is docked in the
MATLAB desktop, use the current directory text field in the desktop toolbar.
Visual Directory and Directory Reports in Current Directory
Browser
There are new tools accessible from the Current Directory browser for tuning
and managing M-files. For details, see “Visual Directory Tool in the Current
Directory Browser” on page 542 and “Directory Reports in the Current
Directory Browser” on page 543.
535
Version 7 (R14) MATLAB® Software
Editing and Debugging M-Files
New features and changes introduced in this version are
• “Opening, Arranging, and Closing Documents” on page 536
• “Visual Changes” on page 537
• “Entering Statements” on page 538
• “Create Block Comments Using %{ and %}” on page 538
• “Finding and Replacing Text” on page 539
• “Printing M-Files” on page 539
• “Breakpoints and Debugging” on page 539
• “Debugging Functions Enhanced” on page 540
• “dbstack Function Supports Nested Functions” on page 540
• “dbstatus Function Supports Conditional Breakpoints” on page 541
• “Access Tools from Editor/Debugger” on page 541
• “Rapid Code Iteration Using Cells” on page 541
• “Preferences for the Editor/Debugger” on page 542
Opening, Arranging, and Closing Documents
Drag File into Editor. You can drag a file onto the Editor to open it. For
example, drag a text file from Windows Explorer onto the Editor.
Automatically Remove Autosave Files — Preference Added.
There is now an Editor/Debugger preference you can set to automatically
remove autosave files when you close the source file. Select
Preferences > Editor/Debugger > Autosave, and under Close options,
select the Automatically delete autosave files check box.
Toggle Between Command Window and Editor/Debugger. To move
from an Editor document to the Command Window, press Ctrl+0. To move
back to the Editor document, press Ctrl+Shift+0.
536
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Editor Remains Open with No Files Open. When you close the last open
document in the Editor, the Editor remains open.
Automatic Reloading of Files When Changes Made Outside of
MATLAB Software. When a file is open in the Editor and you open
that same file outside of MATLAB and make changes to it, the Editor
automatically updates the file to includes the changes you made outside the
Editor. This only applies if you did not make any changes to the file in the
Editor. If you want to be prompted before the Editor updates the file, clear
the Editor/Debugger preference for automatically reloading files.
Open Files While Debugging Preference Moved to Debug Menu. In
the previous version, you used a preference to automatically open files when
debugging. Now, instead of using a preference, you select Open M-Files
When Debugging from the Debug menu in any desktop tool.
With this item selected, when you run an M-file containing breakpoints, the
file opens in the Editor/Debugger when MATLAB encounters a breakpoint.
Visual Changes
Syntax Highlighting for Other Languages. The Editor now supports
syntax highlighting for other languages, specifically ANSI C, C++, Java, and
HTML. Use Editor language preferences to change the colors for the syntax
highlighting.
Datatips Now Off By Default in Edit Mode. In edit mode, datatips
are now off by default. Select the preference to display them in edit mode.
Datatips display until you move the cursor. Datatips are always on in debug
mode.
Vertical Line in Files. There is now a faint line at column 75, which serves
as a useful reminder of where text would be cut off when printing the
document. Remove the line or change the column at which the line appears
using Editor/Debugger Display preferences.
Balance Delimiters Removed. The feature Text > Balance Delimiters
has been removed.
537
Version 7 (R14) MATLAB® Software
Syntax Highlighting Default Colors Modified. The default colors for
syntax highlighting M-files have been modified. Unterminated strings are
now maroon, while terminated strings are now purple. This is the opposite
of previous versions. Maroon is considered to be more of an "alerting" color,
resembling the default of red for errors, which is the reason for the change. If
you prefer the colors used in previous versions, change them using preferences
— see “MATLAB Syntax Highlighting Colors” in the online documentation.
In addition, arguments in statements entered using command syntax rather
than function syntax are highlighted as strings, emphasizing that variables in
command syntax are passed as literal strings rather than as their values.
Entering Statements
Change Case of Selected Text. To change the case of selected text, select
the text and then press
• Alt+U, U to change all text to upper case
• Press Alt+U, L to change all text to lower case
• Press Alt+U, R to change the case of each letter
Nested Function Indenting Supported. MATLAB now supports nested
functions and the Editor provides preferences regarding how to indent them.
Overwrite Mode Supported. When you press the Insert key, text entry
is done in overwrite mode and the cursor assumes a block shape. Press the
Insert key again to return to insert mode.
Create Block Comments Using %{ and %}
You can create a block comment in an M-file using any text editor, that is, you
can comment out contiguous lines of code. Type %{ on the line before the first
line of the comment and %} following the last line of the comment. The lines
in between are considered to be comments. Do not include any code on the
lines with the block comment symbols. You can also nest block comments.
See “Commenting in MATLAB Code Using Any Text Editor” for details.
538
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Compatibility Considerations. Because of the new block comment symbols,
if you have any files with lines that consist only of %{ and %}, they might be
misinterpreted as block comment start and end symbols, and might cause
errors in your file.
Finding and Replacing Text
Find Files and Content Within Files. You can find directories, files,
and content within multiple files. Select Edit > Find Files. For details,
see“Advanced Search for Files — Find Files Tool” in the online documentation.
Incremental Search Now Indicates Direction and is Case Sensitive.
The incremental search interface has been updated. It now indicates the
search direction. It is also case sensitive when you enter uppercase letters in
the search field.
Printing M-Files
Page setup options differ slightly from previous versions.
Breakpoints and Debugging
Conditional Breakpoints Supported. You can specify conditional
breakpoints in an M-file. MATLAB only stops at the line with the breakpoint
if the condition is met. Conditional breakpoints have a yellow breakpoint
icon, which you can copy and paste to other lines.
Disable (Ignore) Breakpoints. You can disable standard and conditional
breakpoints. MATLAB ignores a disabled breakpoint until you enable it
again. A disabled breakpoint icon has an X through it.
Error Breakpoints Supported. Set error breakpoints for all files by
selecting Debug > Stop If Errors/Warnings, and then completing the
resulting dialog box. You can specify a message identifier for an error or
warning breakpoint so that MATLAB stops only if it encounters the specified
error or warning message.
539
Version 7 (R14) MATLAB® Software
Debugging Functions Enhanced
Error Support Added to dbstop and dbclear. Enhancements to
debugging functions include dbstop if caught error, dbclear if caught
error, and dbclear if all error. The dbstop if all error option has
been grandfathered and will not be supported in future versions. To specify
a message identifier, use dbstop if error ID, dbstop if caught error
ID, dbstop if warning ID, and the corresponding dbclear options. The
dbstatus function has been updated to reflect the changes to dbstop and
dbclear.
dbstop Function Supports Nested and Anonymous Functions. The
dbstop function has been updated to support nested and anonymous
functions. See the dbstop reference page for details. You cannot use the
Editor/Debugger GUI to set breakpoints in anonymous functions, but must
use the dbstop function instead. Note that when you save a file in the
Editor/Debugger that contains breakpoints in anonymous functions, those
breakpoints are cleared. They are also cleared when you run an unsaved file
from the Editor/Debugger GUI, because running first saves the file.
Notation for Reporting Path Modified. MATLAB now uses a new notation
for reporting the path of functions, subfunctions, and nested functions. As
an example, A/B>C/D means directory A, file B, (sub)function C within the
file B, and nested function D within C.
dbstack Function Supports Nested Functions
The dbstack function has been updated to supported nested functions. See
the dbstack function reference page for more information.
Compatibility Considerations. If you use dbstack in M-files, you might
need to update your files because of this change. When you run dbstack and
return results to a structure, there are now three fields, whereas in previous
versions, there were only two fields. The fields are
• file, the file in which the function appears
• name, the function name within the file
• line, the line number in the function
540
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
The file field does not contain a complete pathname, as the name
field did in previous versions. To get the complete pathname, use
dbstack('-completenames').
dbstatus Function Supports Conditional Breakpoints
The dbstatus function has been updated to support conditional breakpoints.
See the dbstatus function reference page for more information.
Compatibility Considerations. As a result there have been changes to
some of the fields in the structure returned with s = dbstatus(...). If you
use dbstatus in M-files, you might need to update your files because of this
change. For details on the new format, see the dbstatus reference page.
Access Tools from Editor/Debugger
You can access useful tools for M-files from the Editor/Debugger. From the
Tools menu, select Check Code with M-Lint, Show Dependency Report,
or Open Profiler. For details about these tools, see “Tuning and Managing
M-Files” on page 542.
Rapid Code Iteration Using Cells
In the Editor, cell features allow you to easily make changes to values in a
section of an M-file to readily see the impact of the changes. First, you define
cells in a file, then evaluate a cell or cells, iterate values in the cell, and then
reevaluate the cell(s). Cells also allow you to publish M-file code and results
to popular formats, such as HTML and for the Microsoft Word application.
For details, see “Evaluating Subsections of Files Using Code Cells” in the
online documentation.
Demo of New Rapid Code Iteration Features. If you are using the Help
browser, watch the new Rapid Code Iteration Using Cells video demo for an
overview of the major functionality.
Compatibility Considerations. Because of the new symbols for cell
publishing, if you have any files with lines that consist only of %%, those lines
might be misinterpreted as the start of a cell. Your files will still run without
problems, but if you publish the M-files, you might need to modify those lines.
541
Version 7 (R14) MATLAB® Software
Preferences for the Editor/Debugger
Add New Line to End of File Upon Save. There is now a preference that
allows you to add a new line to the end of a file upon saving.
Open M-Files When Debugging Preference Moved. The feature that
instructs M-files to open automatically when debugging is no longer in
preferences but is now accessible from the Debug menu in all desktop tools.
Tuning and Managing M-Files
Use these tools to fine-tune and manage your M-files, and to prepare them
for distribution to other users. New features introduced in this version are
organized by these topics:
• “Visual Directory Tool in the Current Directory Browser” on page 542
• “Directory Reports in the Current Directory Browser” on page 543
• “Profiler for Measuring Performance” on page 545
Visual Directory Tool in the Current Directory Browser
The Visual Directory view of the Current Directory provides useful
information about the M-files in a directory. It can help you polish M-files
before providing them to others to use.
on the Current Directory
Click the Show Visual Directory button
browser toolbar. To view changes — see the following figure for an example.
To return to the Classic view of the Current Directory browser, click the
button
again.
542
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Directory Reports in the Current Directory Browser
In the Current Directory browser, select View > Directory Reports and
select the type of report to run. The report appears as an HTML document
in the MATLAB Web browser. A summary of the reports follows. For more
information, see “Using MATLAB Reports” in the online documentation.
M-Lint Code Check Report. The M-Lint report displays potential errors
and problems, as well as opportunities for improvement in your code. For
example, one common message is that a variable is defined but never used.
You can also produce an M-Lint report for specified files using the mlint
function, or run the M-Lint report from the Editor/Debugger or Profiler.
543
Version 7 (R14) MATLAB® Software
TODO/FIXME Report. The TODO/FIXME report shows M-files that contain
text strings you included as notes to yourself, such as TODO.
Help Report. The Help report presents a summary view of the help
component of your M-files. Use this information to help you identify files of
interest or to help you identify files that lack help information.
544
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
Contents Report. The Contents report displays information about the
integrity of the Contents.m file for the directory. A Contents.m file is a
file you create that provides a brief description for relevant M-files in the
directory. When you type help followed by the directory name, such as help
mydemos, MATLAB displays the information in the Contents.m file. Use the
Contents report to help you clean up and maintain your Contents.m file. If
there is no Contents.m file, use the Contents report to create one.
Dependency Report. The Dependency report shows all M-files called by
each M-file, or in other words, shows all children of each M-file. Use this
report to determine all files you need to provide to someone who wants to
run an M-file.
File Comparison Report. The File Comparison report identifies the
differences between two files in the current directory. For example, you can
easily compare an autosaved version of a file to the latest version of the file.
Coverage Report. Run the Coverage report after you run the Profile report
to identify what percentage of the file was executed when it was profiled.
Profiler for Measuring Performance
Access Profiler from Desktop or Editor/Debugger. Access the Profiler
from the Desktop menu or the Editor/Debugger Tools menu.
Profiler Summary Report. In the Profiler summary report, click a column
name to sort the report by that column.
Profiler Detail Report. In the Profiler detail report, specify options to show
busy lines (lines where the most time was spent) and to show the file listing
(the M-file code). Other options allow you to run the M-Lint Code Check
report, which provides messages for improving the file, and the Coverage
report, which indicates how much of the file was exercised during profiling.
For more information about these reports, see “Using MATLAB Reports” in
the online documentation. After selecting an option in the detail report, click
Refresh to update the report. The performance acceleration information in
the detail report has been removed.
545
Version 7 (R14) MATLAB® Software
profile Function. The profile function no longer supports the -detail
flag’s builtin option.
Compatibility Considerations. The profile report previously supported
in MATLAB is no longer available. This was the report you generated by
running profile report or profreport. There is a new function, profsave
that replaces profreport. The profsave function saves a static version of the
HTML profile report.
Because the profile function no longer supports the -detail flag’s builtin
option, the only remaining option is mmex, which is also the default. If you
continue to specify the builtin option on the -detail flag, the profile
function will behave as though you specified the mmex option, and no built-in
functions are profiled.
Source Control Changes
In MATLAB version 6.5 (R13) and MATLAB version 7.0 (R14), only source
control systems that comply with the Microsoft Common Source Control
standard are supported. If there is a compliant source control system
installed on your machine, it will be listed in the Source Control options in
the MATLAB Preferences dialog box.
There are several vendors who provide and interface into Revision Control
Systems (RCS), Concurrent Versions System (CVS), and other such tools
using Microsoft Source Code Control API. ComponentSoftware provides one
such interface layer.
Compatibility Considerations
This represents a change to how MATLAB interfaced with source control
systems in prior versions.
Publishing Results
Publishing to HTML, XML, LaTeX, and Formats for Word and
PowerPoint Applications
You can publish M-files to HTML, XML, LaTeX, and to formats for Microsoft
Word and Microsoft® PowerPoint® applications. The published documents can
546
Desktop Tools and Development Environment, MATLAB® Version 7 (R14)
include code, formatted comments, and results, such as graphs in Figure
windows. Use cells and cell publishing features in the Editor/Debugger.
For details, see “Overview of Publishing MATLAB Code” in the online
documentation.
Demo of New Publishing Features. If you are using the Help browser,
watch the new Publishing M Code from the Editor video demo for an overview
of the major functionality.
Notebook
If you currently use Notebook, consider using cell publishing from the Editor
instead, which provides more features and flexibility for most applications.
Notebook has been improved with regards to speed and stability, with a
few minor changes in operation. The improvements were available via a
Web-downloadable update to MATLAB version 6.5, and are now part of
MATLAB version 7.
547
Version 7 (R14) MATLAB® Software
Mathematics, MATLAB Version 7 (R14)
This version introduces the following new features and changes:
New and Obsolete Functions
• “New Functions” on page 550
• “Obsolete Functions” on page 551
Nondouble Math
• “New Nondouble Mathematics Features” on page 551
• “Nondouble Arithmetic” on page 552
• “New Integer Functions — intmax and intmin” on page 553
• “New Warnings for Integer Arithmetic” on page 553
• “Warning on Concatenating Different Integer Classes” on page 554
• “Integer Data Type Functions Now Round Instead of Truncate” on page 555
• “Changes to Behavior of Concatenation” on page 556
• “Class Input for realmax and realmin” on page 556
• “Class Input for ones, zeros, and eye” on page 557
• “Class and Size Inputs for Inf and NaN” on page 558
• “New Class and Data Inputs for eps” on page 558
• “New Class Inputs for sum” on page 559
• “complex Now Accepts Inputs of Different Data Types” on page 560
• “Bit Functions Now Work on Unsigned Integers” on page 560
Matrices and Elementary Math
• “New Function accumarray for Constructing Arrays with Accumulation”
on page 560
• “Enhanced sort Capabilities and Performance” on page 561
548
Mathematics, MATLAB Version 7 (R14)
• “New Functions for Numerical Data Types” on page 562
• “max and min Now Have Restrictions on Inputs of Different Data Types”
on page 562
• “Mathematic Operations on Logical Values” on page 563
Linear Algebra
• “New Function linsolve for Solving Systems of Linear Equations” on page
563
• “New Output for polyeig” on page 563
• “Enhancements to lscov” on page 564
• “New Form for Generalized Hessian” on page 564
Nonlinear Methods
• “New Function quadv Integrates Complex, Array-Valued Functions” on
page 565
Trigonometry, Geometry
• “New Trigonometric Functions For Angles in Degrees” on page 565
• “Matrix, Trigonometric, and Other Math Functions No Longer Accept
Inputs of Type char” on page 566
• “New Warnings for Complex Inputs to atan2, log2, and pow2” on page 566
• “Enhanced Functions for Computational Geometry” on page 567
• “New Support for Interpolation Functions” on page 567
Differential Equations
• “New and Enhanced Functions for Ordinary Differential Equations
(ODEs)” on page 568
549
Version 7 (R14) MATLAB® Software
FFT
• “Enhancements to Discrete Fourier Transform Functions” on page 569
• “FFT Functions Applied to Integer Data Types are Becoming Obsolete”
on page 569
Optimization
• “New Output Function for Optimization Functions” on page 570
Specialized Math
• “New Input Argument for Incomplete Gamma Function” on page 570
Other
• “Overriding the Default BLAS Library on Intel/Windows Systems” on page
571
• “New Names for Demos expm1, expm2, and expm3” on page 572
New Functions
This release introduces the following new functions:
550
Function
Description
accumarray
Construct array with accumulation
cast
Cast variable to different type
expm1
Compute exp(x)-1 accurately for small values of x
intmax
Largest value of specified integer type
intmin
Smallest value of specified integer type
intwarning
Control state of integer warnings
isfloat
Determine whether input is floating-point array
isinteger
Determine whether input is integer array
linsolve
Solve linear system of equations
Mathematics, MATLAB Version 7 (R14)
Function
Description
log1p
Compute log(1+x) accurately for small values of x
nthroot
Real nth root of real numbers
ode15i
Solve fully implicit differential equations, variable
order method
odextend
Extend solution of initial value problem for
ordinary differential equation
quadv
Vectorized quadrature
Obsolete Functions
The functions listed in the left column of the following table are obsolete and
will be removed from a future version of MATLAB.
Compatibility Considerations
Use the replacement functions listed in the right column instead.
Obsolete Function
Replacement Function
colmmd
colamd
quad8
quadl
symmmd
symamd
The following obsolete functions are no longer included in MATLAB:
fmin, fmins, icubic, interp4, interp5, interp6, meshdom, nnls,
saxis
New Nondouble Mathematics Features
MATLAB Version 7.0 supports many arithmetic operations and mathematical
functions on the following nondouble MATLAB data types:
• single
• int8 and uint8
551
Version 7 (R14) MATLAB® Software
• int16 and uint16
• int32 and uint32
Most of the built-in MATLAB functions that perform mathematical operations
now support inputs of type single. In addition, the arithmetic operators and
the functions sum, diff, colon, and some elementary functions now support
integer data types.
Note In Version 7.0, MATLAB only supports mathematical operations
on nondouble data types for built-in functions; it does not support these
operations for M-file functions unless otherwise stated in the M-file help.
Nondouble Arithmetic
This section describes how MATLAB performs arithmetic on nondouble data
types.
Single Arithmetic
You can now combine numbers of type single with numbers of type double or
single. MATLAB performs arithmetic as if both inputs had type single and
returns a result of type single. For more information, see “Single-Precision
Floating Point” in the online MATLAB Programming documentation.
Integer Arithmetic
You can now combine numbers of an integer data type with numbers of the
same integer data type or type scalar double. MATLAB performs arithmetic
as if both inputs had type double and then converts the result to the same
integer data type.
MATLAB computes operations on arrays of integer data type using saturating
integer arithmetic. Saturating means that if the result is greater than the
upper bound of the integer data type, MATLAB returns the upper bound.
Similarly, if the result is less than the lower bound of the data type, MATLAB
returns the lower bound. For more information, see “Integers” in the online
MATLAB Programming documentation.
552
Mathematics, MATLAB Version 7 (R14)
New Integer Functions — intmax and intmin
Two new functions, intmax and intmin, return the largest and smallest
numbers, respectively, for integer data types. For example,
intmax('int8')
ans =
127
returns the largest number of type int8. See “Largest and Smallest Values for
Integer Classes” in the online MATLAB documentation for more information.
New Warnings for Integer Arithmetic
This section describes four new warning messages for integer arithmetic in
Version 7.0. While these warnings are turned off by default, you can turn
them on as a diagnostic tool or to warn of behavior in integer arithmetic that
might not be expected.
To turn all four warning messages on at once, enter
intwarning on
Integer Conversion of Noninteger Values
MATLAB can now return a warning when it rounds up a number in
converting to an integer data type. For example,
int8(2.7)
Warning: Conversion rounded non-integer floating point value to
nearest int8 value.
ans =
3
Integer Conversion of NaN
When MATLAB converts NaN (Not-a-Number) to an integer data type, the
result is 0. MATLAB can now return a warning when this occurs. For
example,
int16(NaN)
553
Version 7 (R14) MATLAB® Software
Warning: NaN converted to int16(0).
ans =
0
Integer Conversion Overflow
MATLAB can now return a warning when you convert a number to an integer
data type and the number is outside the range of the data type. For example,
int8(300)
Warning: Out of range value converted to intmin('int8') or
intmax('int8').
ans =
127
Integer Arithmetic Overflow
MATLAB can now return a warning when the result of an operation on integer
data types is either NaN or outside the range of that data type. For example,
int8(100) + int8(100)
Warning: Out of range value or NaN computed in integer arithmetic.
ans =
127
To turn all of these warnings off at once, enter
intwarning off
Warning on Concatenating Different Integer Classes
If you concatenate integer arrays of different integer classes, MATLAB
displays the warning
Concatenation with dominant (left-most) integer class may
overflow other operands on conversion to return class.
The class of the resulting array is the same as the dominant (or left-most)
value in the concatenation:
554
Mathematics, MATLAB Version 7 (R14)
a = int8([52 37 89; 23 16 47]);
b = int16([74 61 32; 98 73 25]);
% Combine int8 and int16 (int8 is dominant)
c = [a b];
class(c)
ans =
int8
% Combine int16 and int8 (int16 is dominant)
c = [b a];
class(c)
ans =
int16
Integer Data Type Functions Now Round Instead of
Truncate
The following integer data functions now round noninteger inputs instead of
truncating:
int8, uint8, int16, uint16, int32, uint32, int64, uint64
For example, in MATLAB 7.0,
int8(3.7)
returns
ans =
4
Compatibility Considerations
In previous releases, the same command returned 3. If you have code that
contains these functions, it might return different results in Version 7.0 than
in previous releases, in particular, results that differ by 1 after converting
floating-point inputs to an integer data type.
You can turn the following warning on to help diagnose these differences:
555
Version 7 (R14) MATLAB® Software
warning on MATLAB:intCovertNonIntVal
See “New Warnings for Integer Arithmetic” on page 553 for more information
about this and other new warning messages.
Changes to Behavior of Concatenation
When you perform concatenation ([a, b], [a;b], and cat(a,b,dim)) on
mixed integer and other numeric or logical inputs, the left-most integer type
among the inputs is the type of the result. As a result, the other inputs might
lose values when they are converted to the integer data type. In Version
7.0, MATLAB now returns a warning when you concatenate these mixed
data types.
For example,
[int8(100) uint8(200)]
Warning: Concatenation with dominant (left-most) integer class
may overflow other operands on conversion to return class.
(Type "warning off MATLAB:concatenation:integerInteraction" to
suppress this warning.)
ans =
100
127
class(ans)
ans =
int8
Compatibility Considerations
Concatenating an input of any nondouble numeric data type (single and
integer data type) with type char now returns a result of type char. In
previous releases, the same operation returned a result of the same type as
the numeric data type.
Class Input for realmax and realmin
You can now call the function realmax with the syntax
realmax('single')
556
Mathematics, MATLAB Version 7 (R14)
ans =
3.4028e+038
which returns the largest single-precision number. Similarly,
realmin('single')
returns the smallest single-precision number.
The commands realmax('double') and realmin('double') return the same
results as realmax and realmin, respectively. See “Largest and Smallest
Values for Floating-Point Classes” in the online MATLAB Programming
documentation for more information.
Class Input for ones, zeros, and eye
You can now call ones or zeros with an input argument specifying the data
type of the output. For example,
ones(m, n, p, ...,
'single')
or
ones([m, n, p, ...], 'single')
returns an m-by-n-by-p-by ... array of type single containing all ones. zeros
uses the same syntax.
You can now call eye with this input argument for two-dimensional arrays.
For example,
eye(m, 'single')
returns an m-by-m identity matrix of type single. The command
eye(m, n, 'int8')
returns an m-by-n array of type int8.
557
Version 7 (R14) MATLAB® Software
Class and Size Inputs for Inf and NaN
The functions Inf and NaN now accept inputs that enable you to create Infs or
NaNs of specified sizes and floating-point data types. As examples,
• Inf('single') or NaN('single') create the single-precision
representations of Inf and NaN, respectively.
• Inf(m,n,p, ...) or NaN(m,n,p,...) create m-by-n-by-p-by-... arrays of
Infs or NaNs, respectively.
See the reference pages for Inf and NaN for more information.
New Class and Data Inputs for eps
You can now call the function eps with the syntax
eps(x)
If x has type double, eps(x) returns the distance from x to the next largest
double-precision floating point number. This is a measure of the accuracy of x
as a double-precision number. eps(1) returns the same value as eps with no
input argument.
You can now replace expressions of the form
if Y < eps * abs(X)
with
if Y < eps(X)
If x has type single, eps(x) returns the distance from x to the next largest
single-precision floating point number. This is a measure of the accuracy of x
as a single-precision number.
The command
eps('single')
ans =
1.1921e-007
558
Mathematics, MATLAB Version 7 (R14)
returns the same value as eps(single(1)). The value of eps('single') is
the same as single(2^-23). The command eps('double') returns the same
result as eps.
See “Accuracy of Floating-Point Data” in the online MATLAB documentation
for more information.
New Class Inputs for sum
The following new input arguments for sum control how the summation is
performed on numeric inputs:
• s = sum(x,'native') and s = sum(x, dim,'native') accumulate in the
native type of its input and the output s has the same data type as x. This
is the default for single and double.
• s = sum(x,'double') and s = sum(x, dim, 'double') accumulate in
double-precision. This is the default for integer data types.
In Version 7.0, sum applied to a vector of type single performs single
accumulation and returns a result of type single. In other words, sum(x) is
the same as sum(x, 'native') if x has type single. This is a change in the
behavior of sum from previous releases. To make sum accumulate in double,
as in previous releases, use the input argument 'double'.
Compatibility Considerations
In Version 7.0, sum applied to a vector of type single performs single
accumulation and returns a result of type single. In previous releases, sum
performed this operation in double accumulation.
To restore the previous behavior, call sum with the syntax
sum(X, 'double')
or
sum(X, dim, 'double')
559
Version 7 (R14) MATLAB® Software
complex Now Accepts Inputs of Different Data Types
The function complex now accepts inputs of different data types when you
use the syntax
complex(a,b)
according to the following rules:
• If either of a or b has type single, c has type single.
• If either of a or b has an integer data type, the other must have the same
integer data type or type scalar double, and c has the same integer data
type.
Bit Functions Now Work on Unsigned Integers
The following functions now work on unsigned integer inputs:
bitand, bitcmp, bitget, bitor, bitset, bitshift, bitxor
Instead of using flints (integer values stored in floating point) to do your
bit manipulations, consider using unsigned integers, as a more natural
representation of bit strings. Instead of using bitmax, use the intmax function
with the appropriate class name. For example, use intmax('uint32') if you
are working with unsigned 32 bit integers.
In addition, the function bitcmp now accepts the following new syntax for
inputs of type uint8, uint16, and uint32:
bitcmp(A)
bitcmp now uses the data type of A to determine how to take the bitwise
complement.
New Function accumarray for Constructing Arrays
with Accumulation
The new accumarray function enables you to construct an array with
accumulation. The following example uses accumarray to construct a 5-by-5
matrix A from a vector val. The function accumarray adds the entries of val
to A at the indices specified by the matrix ind, which has the same number of
560
Mathematics, MATLAB Version 7 (R14)
rows as val. If an index in ind is repeated, the entries of val accumulate at
the corresponding entry of A.
ind = [1 2 5 5;1 2 5 5]';
val = [10.1 10.2 10.3 10.4]';
A = accumarray(ind, val)
A =
10.1000
0
0
0
0
0
10.2000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
20.7000
To get the (5,5) entry of A, accumarray adds the entries of val corresponding
to repeated pair of indices (5,5).
A(5, 5) = 10.3 + 10.4
In general, if ind has ndim columns, A will be an N-dimensional array with
ndim dimensions, whose size is max(ind).
Enhanced sort Capabilities and Performance
Improved Performance
sort performance has been improved for numeric arrays of randomly ordered
data. Although there is some performance improvement for all such numeric
arrays, you should see the greatest improvement for integer arrays and
multidimensional arrays.
Sort Direction
A new argument, mode, lets you specify whether sort returns the sorted array
in ascending or descending order.
561
Version 7 (R14) MATLAB® Software
New Functions for Numerical Data Types
MATLAB 7.0 contains three new functions for detecting and converting data
types:
• cast enables you to cast a variable to a different data type or class
• isfloat enables you to detect floating-point arrays. isfloat(A) returns 1
if A has type double or single and 0 otherwise. isfloat(A) is the same
as isa(A,'float').
• isinteger enables you to detect integer arrays. isinteger(A) returns 1
if A has integer data type and 0 otherwise. isinteger(A) is the same as
isa(A,'integer')
max and min Now Have Restrictions on Inputs of
Different Data Types
In MATLAB 7.0, the functions max and min now have the following restrictions
on inputs of different data types:
• If any input has an integer data type, all other inputs must have the same
integer data type or type scalar double.
• If any input is of type single, all other inputs must have type double or
single.
Other combinations of inputs now return an error message. In previous
releases, inputs to max or min could have any combination of data types.
For the allowed mixed-type combinations listed above, max and min now
return results of a different data type than in previous releases:
• If one input has an integer data type, while another has type double, the
result now has the same integer data type. In previous releases, the result
had type double.
• If one input has type single, while another has type double, the result
now has type single. In previous releases, the result had type double.
You can turn on the following warning messages to diagnose any issues that
might result from this change in behavior:
562
Mathematics, MATLAB Version 7 (R14)
• warning on MATLAB:max:mixedIntegersScalarDoubleInputs
• warning on MATLAB:max:mixedSingleDoubleInputs
• warning on MATLAB:min:mixedIntegersScalarDoubleInputs
• warning on MATLAB:min:mixedSingleDoubleInputs
Compatibility Considerations
Combinations of inputs other than those listed above now return an error
message. Also, for these allowed mixed-type combinations, max and min now
return results of a different data type than in previous releases:
Mathematic Operations on Logical Values
Most mathematic operations are not supported on logical values.
New Function linsolve for Solving Systems of Linear
Equations
The new linsolve function enables you to solve systems of linear equations
of the form Ax = b more quickly when the matrix of coefficients A has a special
form, such as upper triangular. When you specify one of these special types of
systems, linsolve is faster than mldivide or \ (backslash) because it does
not check whether the matrix actually has the form you specify.
Note If the matrix A does not have the form you specify in opts, linsolve
returns incorrect results because it does not perform error checking. If you
are unsure of the form of A, use mldivide, or \ instead.
New Output for polyeig
The function polyeig can now return a vector of condition numbers for the
eigenvalues, when you call it with the syntax
[X,E,S] = polyeig(A0,A1,..,Ap)
At least one of A0 and Ap must be nonsingular. Large condition numbers
imply that the problem is close to one with multiple eigenvalues.
563
Version 7 (R14) MATLAB® Software
Enhancements to lscov
The command
lscov(A,b,V)
now accepts either a weight vector or a covariance matrix for V. If you enter
lscov(A,b) without a third argument, lscov uses the identity matrix for V.
The command lscov(A, b, V, alg) now enables you to specify the
algorithm used to compute the result when V is a matrix. You can specify
alg to be one of the following:
• 'chol' uses the Cholesky decomposition of V
• 'orth' uses the orthogonal decomposition of V
The command
[x stdx mse] = lscov(...)
now returns mse, the mean squared estimate (MSE).
The command
[x stdx mse S] = lscov(...)
now returns S, the estimated covariance matrix of x.
In addition, lscov can now accept a design matrix A that is rank deficient and
a covariance matrix, V, that is positive semidefinite.
New Form for Generalized Hessian
The function hess has a new syntax of the form
[AA,BB,Q,Z] = hess(A,B)
where A and B are square matrices, and returns an upper Hessenberg matrix
AA, an upper triangular matrix BB, and unitary matrices Q and Z such that
Q*A*Z = AA
564
Mathematics, MATLAB Version 7 (R14)
and
Q*B*Z = BB
New Function quadv Integrates Complex,
Array-Valued Functions
The new function quadv integrates complex, array-valued functions.
New Trigonometric Functions For Angles in Degrees
The following new functions compute trigonometric functions of arguments in
degrees.
Function
Purpose
sind
Compute the sine of an argument in degrees
cosd
Compute the cosine of an argument in degrees
tand
Compute the tangent of an argument in degrees
cotd
Compute the cotangent of an argument in degrees
secd
Compute the secant of an argument in degrees
cscd
Compute the cosecant of an argument in degrees
The following new functions compute the inverse trigonometric functions are
return the answer in degrees:
Function
Purpose
asind
Compute the inverse sine of an argument and return
answer in degrees
acosd
Compute the inverse cosine of an argument and return
answer in degrees
atand
Compute the inverse tangent of an argument and return
answer in degrees
acotd
Compute the inverse cotangent of an argument and
return answer in degrees
565
Version 7 (R14) MATLAB® Software
Function
Purpose
asecd
Compute the inverse secant of an argument and return
answer in degrees
acscd
Compute the inverse cosecant of an argument and return
answer in degrees
Matrix, Trigonometric, and Other Math Functions No
Longer Accept Inputs of Type char
Matrix functions, such as chol, lu, and svd, and trigonometric functions, such
as sin and cos, no longer accept inputs of type char. In previous releases,
these functions simply converted char inputs to double before performing
operations on them.
Compatibility Considerations
To restore the previous behavior of these functions, create an M-file that
converts its input to double before applying the function. For example, to
restore the behavior of sin,
1 Create a directory called @char in a directory on the MATLAB path, for
example, your work directory.
2 Create an M-file with the following commands:
function s = sin(x)
s = sin(double(x));
3 Save the file as sin.m in the directory @char.
New Warnings for Complex Inputs to atan2, log2,
and pow2
The following functions now return a warning for inputs that are not real
numbers:
• atan2(y,x)
• [f,e] = log2(x)
566
Mathematics, MATLAB Version 7 (R14)
• pow2(f,e)
Enhanced Functions for Computational Geometry
The following functions, which perform geometric computations on a set of
points in N-dimensional space, now provide many new options:
• convhull — Compute convex hulls
• convhulln — Compute N-dimensional convex hulls
• delaunay — Construct Delaunay triangulation
• delaunay3 — Construct 3-dimensional Delaunay tessellations
• delaunayn — Construct N-dimensional Delaunay tessellations
• griddata — Data gridding and surface fitting
• griddata3 — Data gridding and surface fitting for 3-dimensional data
• griddatan — Data gridding and hypersurface fitting (dimensions >= 2)
• voronoi — Construct Voronoi diagrams
• voronoin — Construct N-dimensional Voronoi diagrams
These functions now accept an input cell array options that gives you
greater control over how they perform calculations. These functions use the
software Qhull, created at the National Science and Technology Research
Center for Computation and Visualization of Geometric Structures (the
Geometry Center). For more information on the available options, see
http://www.qhull.org/.
New Support for Interpolation Functions
The following interpolation functions now have enhanced features:
• interp1 — The command YI = interp1(X,Y,XI) now accepts a
multidimensional array Y and returns an array of the correct dimensions. If
Y is an array of size [n,m1,m2,...,mk], interp1 performs interpolation for
each m1-by-m2-by-...-mk value in Y. If XI is an array of size [d1,d2,...,dj],
YI has size [d1,d2,...,dj,m1,m2,...,mk].
567
Version 7 (R14) MATLAB® Software
The command pp = interp1(X,Y,'method','pp') uses the specified
method to generate the piecewise polynomial form (ppform) of Y. See the
reference page for interp1 for information about the available methods.
• interp2, interp3, and interpn — You can now pass in a scalar argument,
ExtrapVal, which these functions return for any values of XI and YI that
lie outside the range of values spanned by X and Y defining the grid. For
example,
ZI = interp2(X,Y,Z,XI,YI,'method',ExtrapVal)
returns the value of ExtrapVal for any values of XI or YI that are outside
the range of values spanned by X and Y.
• ppval now accepts multidimensional arrays returned by the spline
function using the syntax
YY = ppval(spline(X,Y), XX)
Each entry of YY is obtained by evaluating spline(X,Y) at the
corresponding value of XX.
• spline — The command YY = spline(X,Y,XX) now accepts a
multidimensional array Y and returns an array of the correct
dimensions. Note that YY = spline(X,Y,XX) is the same as
YY = ppval(spline(X,Y), XX).
If spline(X, Y) is scalar-valued, then YY is of the same size as XX. If
spline(X, Y)is [D1,..,Dr]-valued, and XX has size [N1,...,Ns], then
YY has size [D1,...,Dr, N1,...,Ns], where YY(:,...,:, J1,...,Js) is
the value of spline(X, Y) at XX(J1,...,Js). There are two exceptions
to this rule:
New and Enhanced Functions for Ordinary
Differential Equations (ODEs)
MATLAB 7.0 provides two new functions for solving implicit ODEs and
extending solutions to ODEs, along with several enhancements to existing
ODE-related functions:
• ode15i, which is new in Version 7.0, provides the capability to solve fully
implicit ODE and DAE problems of the form
with consistent
initial conditions, i.e.,
. ode15i provides an interface that is
568
Mathematics, MATLAB Version 7 (R14)
similar to that of the other MATLAB ODE solvers and is as easy to use. A
supporting function decic helps you calculate consistent initial conditions.
The existing functions odeset and odeget enable you to set integration
properties that affect the problem solution. deval evaluates the numerical
solution obtained with ode15i.
• odextend, which is new in Version 7.0, enables you to extend the solution
to an ODE created by an ODE solver.
• bvp4c can now solve multipoint boundary value problems. To see an
example of how to solve a three-point boundary value problem, enter
threebvp. To see the code for the example, enter edit threebvp. Enter
help bvp4c to learn more about bvp4c.
• deval can now evaluate the derivative of the solution to an ODE as well as
the solution itself. The command
[psxint, spxint] = deval(sol,xint)
returns spxint, the value of the derivative to sol.
Enhancements to Discrete Fourier Transform Functions
The new function fftw enables you to optimize the speed of the discrete
Fourier transform (DFT) functions fft, ifft, fft2, ifft2, fftn, and ifftn.
You can use fftw to set options for a tuning algorithm that experimentally
determines the fastest algorithm for computing a discrete Fourier transform
of a particular size and dimension at run time.
The functions ifft, ifft2, and ifftn now accept the input argument
'symmetric', which causes these functions to treat the array X as conjugate
symmetric. This option is useful when X is not exactly conjugate symmetric,
merely because of round-off error.
FFT Functions Applied to Integer Data Types are
Becoming Obsolete
In previous releases, the following fast Fourier transform (FFT) and related
functions cast integer inputs of type uint8 and uint16 to double, used the
double algorithm, and returned a double result:
• fft
569
Version 7 (R14) MATLAB® Software
• fftn
• ifft
• ifftn
• conv2
In Version 7.0, these operations return warning messages that recommend
convert the inputs to double before applying the function, for example, by
fft(double(x)).
New Output Function for Optimization Functions
In MATLAB 7.0, you can create an output function for several optimization
functions in MATLAB. The optimization function calls the output function
at each iteration of its algorithm. You can use the output function to obtain
information about the data at each iteration or to stop the algorithm based
on the current values of the data. You can use the output function with the
following optimization functions:
• fminbnd
• fminsearch
• fzero
• N1 is ignored if XX is a row vector, that is, if N1 is 1 and s is 2.
• spline ignores any trailing singleton dimensions of XX.
New Input Argument for Incomplete Gamma
Function
The incomplete gamma function, gammainc, now accepts the input argument
tail, using the syntax
Y = gammainc(X,A,tail)
tail specifies the tail of the incomplete gamma function when X is
non-negative. The choices are for tail are 'lower' (the default) and 'upper'.
The upper incomplete gamma function is defined as
570
Mathematics, MATLAB Version 7 (R14)
1 - gammainc(x,a)
Overriding the Default BLAS Library on
Intel/Windows Systems
Note Intel has used aggressive optimization to compile MKL. This
optimization causes NaNs to be treated as zeros in some situations.
Calculations that do not involve NaNs are done correctly. In some calculations
that do involve NaNs, the NaNs will not propagate.
MATLAB uses the Basic Linear Algebra Subroutines (BLAS) libraries to
speed up matrix multiplication and LAPACK-based functions like eig, svd,
and \ (mldivide). At start-up, MATLAB selects the BLAS library to use.
For R14, MATLAB still uses the ATLAS BLAS libraries, however, on Windows
systems running on Intel processors, you can switch the BLAS library that
MATLAB uses to the Math Kernel Library (MKL) BLAS, provided by Intel.
If you want to take advantage of the potential performance enhancements
provided by the Intel BLAS, you can set the value of the environment variable
BLAS_VERSION to the name of the MKL library, mkl.dll. MATLAB uses the
BLAS specified by this environment variable, if it exists.
To set the BLAS_VERSION environment variable, follow this procedure:
1 Click the Start button, go to the Settings menu, and select Control
Panel.
2 On the Control Panel menu, select System.
3 In the System Properties dialog box, click the Advanced tab.
4 On the Advanced panel, click the Environment Variables button.
5 In the Environment Variables dialog box, click the New button in the
User variables section.
571
Version 7 (R14) MATLAB® Software
6 In the New User Variable dialog box, enter the name of the variable as
BLAS_VERSION and set the value of the variable to the name of the MKL
library: mkl.dll.
Multithreading Disabled in Intel Math Kernel Library (MKL)
BLAS
The Intel Math Kernel Library (MKL) is multithreaded in several areas. By
default, this threading capability is disabled. To enable threading in the
MKL library, set the value of the OMP_NUM_THREADS environment variable.
Intel recommends setting the value of the OMP_NUM_THREADS variable to the
number of processors you want to use in your application.
To set the value of this environment variable, follow the instructions outlined
in “Overriding the Default BLAS Library on Intel/Windows Systems” on page
571.
Before enabling multithreading, read the Intel Math Kernel Library 6.1
for Windows Technical User Notes that explains certain limitations of this
capability.
New Names for Demos expm1, expm2, and expm3
The demos expm1, expm2, and expm3 have been renamed expmdemo1,
expmdemo2, and expmdemo3, to avoid a name conflict with the new function
expm1.
Compatibility Considerations
If you have code that relies on these function names, you will need to change
the names in your code.
572
Programming, MATLAB Version 7 (R14)
Programming, MATLAB Version 7 (R14)
Caution If you have saved data to a MAT-file using MATLAB Release 14
Beta 2, please read “MAT-Files Generated By Release 14 Beta2 Must Be
Reformatted” on page 577.
This version introduces the following new features and changes:
Save and Load
• “MATLAB Stores Character Data As Unicode; Making Release 14
MAT-files Readable in Earlier Versions” on page 576
• “MAT-Files Generated By Release 14 Beta2 Must Be Reformatted” on page
577
• “Unicode-Based Character Classification” on page 578
• “Character Rendering on Linux” on page 578
• “Additional Bytes Reserved in MAT-File Header; Do Not Write To Reserved
Space” on page 578
• “Compressed Data Support in MAT-Files” on page 579
• “Saving Structures with the save Function” on page 579
Function Dispatching
• “Case-Sensitivity in Function and Directory Names; Can Affect Which
Function MATLAB Selects” on page 579
• “Differences Between Built-Ins and M-Functions Removed; Can Affect
Which Function MATLAB Selects” on page 584
• “Warning on Naming Conflict” on page 586
• “Change to How evalin Evaluates Dispatch Context” on page 586
573
Version 7 (R14) MATLAB® Software
Functions and Scripts
• “Summary of New Functions” on page 587
• “New Function Type — Anonymous Functions” on page 588
• “New Function Type — Nested Functions” on page 590
• “Calling Private Functions From Scripts” on page 591
• “New Calling Syntax for Function Handles; Replace eval With New Syntax”
on page 591
• “Arrays of Function Handles” on page 592
• “Calling nargin and nargout with Built-In Functions” on page 592
• “Comma Separators Not Required in Function Declaration” on page 593
Changes to Specific Functions
• “getfield and setfield Not To Be Deprecated” on page 593
• “isglobal Function To Be Discontinued” on page 593
• “Recycle to Protect Files from Unwanted Deletion” on page 594
• “bin2dec Ignores Space Characters” on page 594
• “dbstop crashes Are Now Resolved” on page 594
• “Bit Functions on Unsigned Integers” on page 595
• “inmem Returns Path Information” on page 595
Specific Data Types
• “New Features for Nondouble Data Types” on page 595
• “Mathematic Operations on Logical Values” on page 595
• “Accessing Cell and Structure Arrays Without deal” on page 595
Characters and Strings
• “New Features in Regular Expression Support” on page 596
574
Programming, MATLAB Version 7 (R14)
• “Functions that Use Regular Expressions” on page 597
• “Regular Expressions Accept String Vector; No Longer Support Character
Matrix Input” on page 598
• “Cell Array Support for String Functions” on page 598
• “Additional Class Output From mat2str” on page 598
• “String Properties” on page 599
• “Using strtok on Cell Arrays of Strings” on page 599
• “Colon Operator on char Now Returns a char” on page 599
Dates and Times
• “datestr Returns Date In Localized Format” on page 600
• “Form and Locale for weekday” on page 600
• “Freestyle Date String Format” on page 600
• “Reading Date Values with xlsread; Conversion No Longer Necessary”
on page 600
File I/O
• “Comprehensive Function for Reading Text Files” on page 601
• “New Inputs and Outputs to xlsread” on page 602
• “New Inputs and Syntax for dlmwrite” on page 602
• “Change in Output from xlsfinfo” on page 603
• “Importing Complex Arrays” on page 604
• “Using imread to Import Subsets of TIFF Images” on page 604
• “Getting Information about Multimedia Files” on page 605
• “All-Platform Audio Recording and Playback” on page 605
• “FTP File Operations” on page 606
• “Web Services (SOAP)” on page 606
• “64-Bit File Handling on MacIntosh” on page 606
575
Version 7 (R14) MATLAB® Software
Error Handling
• “Changes to Error Message Format” on page 606
• “nargchk Has a New Format for Error Messages” on page 609
• “Enabling and Disabling Warning Messages” on page 610
• “Catching Ctrl+C in try-catch Statements” on page 610
• “Assignment Error Removed” on page 611
Other Topics
• “MATLAB Performance Acceleration” on page 611
• ““Using MATLAB” Documentation Is Now Three Books” on page 612
MATLAB Stores Character Data As Unicode; Making
Release 14 MAT-files Readable in Earlier Versions
Prior releases of MATLAB represented character data in memory using a
system default character encoding scheme that was padded out to 16-bits.
This was the case both in memory and in MAT-files. If this data needed to be
accessible to multiple users, each user’s system had to use the same character
encoding scheme. For those users whose default encoding scheme differed,
the exchange of character-oriented information was not possible.
In Release 14, this limitation is removed by adopting the Unicode character
encoding scheme in mxArrays and their storage in MAT-files. For more
information regarding Unicode, consult the Unicode Consortium web site at
http://www.unicode.org.
For information on the internal formatting of MAT-files, see the "MAT-File
Format" document in the MATLAB documentation available in PDF format
Compatibility Considerations
Release 14 MATLAB writes character and figure data to MAT-files using
Unicode character encoding by default. This is now the default encoding used
by MATLAB when writing to MAT-files with the save and hgsave functions
or with the MAT-file external interface functions.
576
Programming, MATLAB Version 7 (R14)
Unicode encoded MAT-files are not readable by earlier versions of MATLAB.
Thus, if you save data to a MAT-file using MATLAB Release 14, and you
intend to load this MAT-file into an earlier release of MATLAB, you must
override the default encoding during the save, as explained in this section.
You can override the default encoding by using the -v6 switch with save
and hgsave:
save filename -v6
hgsave filename -v6
or, when saving with MAT functions, by setting the mode to “wL” on the
matOpen operation:
matOpen(filename, "wL");
MAT-Files Generated By Release 14 Beta2 Must Be
Reformatted
Any MAT-files that you created with Release 14 Beta 2 were written using an
internal format that is no longer supported by MATLAB.
Compatibility Considerations
If you need to import data from these files using any release besides Release
14 Beta 2, you must first regenerate the files as described in this section. You
cannot read these files using other releases of MATLAB 7.0, and attempting
to read them with MATLAB 6.5 or 6.5.1 will corrupt memory.
There are two ways in which you can regenerate your MAT-file:
• If you want to use the MAT-file with earlier versions of MATLAB,
regenerate the file using the local character set for your system. To do this,
run MATLAB R14 prerelease or MATLAB R14 Beta 2, load the MAT-file,
and rewrite the file using the command
save filename -v6
• If you want to use the MAT-file with R14 LCS or later, regenerate the
file using Unicode character encoding. To do this, run MATLAB R14
prerelease, load the MAT-file, and rewrite it using the following command
that uses the -unicode default.
577
Version 7 (R14) MATLAB® Software
save filename
Caution The final R14 release of MATLAB does not allow you to import a
MAT-file written with Release 14 Beta 2. You will get an error if you attempt
to do this. To use a Beta 2 MAT-file with Release 14, you must first reformat
the file with MATLAB R14 prerelease as described above.
If you no longer have access to Release 14 Beta2 or the R14 prerelease, then
you must regenerate the data and save it again.
Unicode-Based Character Classification
Unicode-based character classification APIs are now provided in MATLAB.
The new character classification functions work with any locale or language
and resolve all locale-specific issues that existed in prior releases.
Character Rendering on Linux
Character data rendering has been improved for Linux operating systems
that are configured with a UTF-8 default character set.
Additional Bytes Reserved in MAT-File Header; Do
Not Write To Reserved Space
In previous releases of MATLAB, the last 4 bytes of the 128-byte MAT-file
header were reserved for use by the MathWorks. In Release 14, the last 12
bytes of this header are reserved. See the PDF file “MAT-File Format” for
more information.
Compatibility Considerations
If you have programs that write to any of the last 12 bytes of the MAT-file
header, or if they rely on the state of the 8 additional header bytes that are
reserved as of this release, you will probably need to change your code. These
bytes are now used by MATLAB. If your code writes to these bytes, MATLAB
is likely to overwrite this data. If your code reads these bytes, they might not
be in the same state as they were in previous releases of MATLAB.
578
Programming, MATLAB Version 7 (R14)
Compressed Data Support in MAT-Files
The save function compresses your workspace variables as they are saved to
a MAT-file. When writing a MAT-file that you will need to load using an
earlier version of MATLAB, be sure to use the save -v6 command. When
you use the -v6 switch, MATLAB saves the data without compression and
without Unicode character encoding. This makes the resulting file compatible
with MATLAB Version 6 and earlier.
You can also compress data when using MAT-file interface library functions
(matPut*) to write to a MAT-file by opening the file with the command
matOpen wz. See the section “MAT-File Versions” in the MATLAB Data
Import and Export documentation for more information on this feature.
Saving Structures with the save Function
Two new syntaxes for the save function enable you to save individual fields of
a structure to a file. See the function reference for save for more information.
To save all fields of the scalar structure s as individual variables within the
file, myfile.mat, use
save('myfile',
-struct ,
s )
To save as individual variables only those structure fields specified (s.f1,
s.f2, ...), use
save('myfile',
-struct ,
s ,
f1 ,
f2 , ...)
Case-Sensitivity in Function and Directory Names;
Can Affect Which Function MATLAB Selects
Prior to this release, filenames for MATLAB functions and Simulink models,
(M, P, MEX, DLL, and MDL files) and also directory names were interpreted
somewhat differently by MATLAB with regards to case sensitivity, depending
upon which platform you were running on. Specifically, earlier versions of
MATLAB handled these names with case sensitivity on UNIX, but without
case sensitivity on Windows.
This release addresses the issue of case sensitivity in an effort to make
MATLAB consistent across all supported platforms. By removing these
579
Version 7 (R14) MATLAB® Software
differences, we hope to make it easier for MATLAB users to write platform
independent code.
Case Sensitivity in MATLAB 6 and Earlier
There are several rules regarding case sensitivity that were already consistent
across all platforms in MATLAB 6, and remain in effect on all platforms in
MATLAB 7. MATLAB interprets each of the following with case sensitivity
on both Windows and UNIX:
• Function names that correspond to MATLAB built-ins
• M-file subfunction names
• The names of functions imported from another language environment,
such as Java or COM
UNIX. On all UNIX platforms, including the new implementation on
MacIntosh, all function, model, and directory names were case sensitive
and required an exact match. This rule remains true for UNIX systems in
MATLAB 7.
Windows. On Windows platforms, MATLAB 6 obeys the following rules.
These rules are changing in MATLAB 7:
• Function and model names were not case sensitive.
• Directory names, including MATLAB class directory names (e.g., @MyClass)
and private directory names (e.g., prIVAte) were not case sensitive.
Case Sensitivity in MATLAB 7
MATLAB 7 removes the platform specific behaviors by adopting its UNIX
case sensitivity rules on Windows systems. MATLAB running on Windows
now gives preference to an exact (case sensitive) name match, but falls back
to an inexact (case insensitive) match when no exact match can be found.
Compatibility Considerations
There are four main conditions under which MATLAB 7 interprets directory
or function names differently in regards to case sensitivity:
580
Programming, MATLAB Version 7 (R14)
• “Two Files of the Same Name” on page 581
• “Two Method Files of the Same Name” on page 582
• “One File with an Inexact Match” on page 582
• “Private Directory Names” on page 583
In any of these cases, each described below, there is a potential for MATLAB
to select a file other than the one you had intended.
Whenever MATLAB 7 detects a potential naming conflict related to case
sensitivity, it issues a warning. If you get one of these warnings when running
a MATLAB program, you may want to modify the related code to eliminate
the warning, or you may wish to simply disable the warning. To disable this
type of warning, see “Turning Off Warnings Caused by Case Mismatch” on
page 584.
Two Files of the Same Name. Consider the situation in which there are
two or more directories on the MATLAB path that contain a function or model
file of the same name. The names of these M-files differ only in letter case:
H:\released\myTestFun.m
K:\under_test\mytestfun.m
Of these two directories, H:\released is closer to the beginning of the
MATLAB path and, thus, has priority over the other:
path = H:\released; K:\under_test; ...
On Windows Platforms —
• In MATLAB 6, executing the function mytestfun invokes
H:\released\myTestFun.m.
• In MATLAB 7, executing the function mytestfun invokes
K:\under_test\mytestfun.m and also displays the following warning:
Function call mytestfun invokes K:\under_test\mytestfun.m
however, function H:\released\myTestFun.m, that differs only in
case, precedes it on the path.
581
Version 7 (R14) MATLAB® Software
On UNIX Platforms —
MATLAB 7 does the same as on Windows, except that the warning message
is disabled by default.
Two Method Files of the Same Name. In this case, there are two M-files
of the same name that implement methods of a MATLAB base class and
one of its subclasses:
@baseclass/my_method.m
@subclass/My_Method.m
On Windows Platforms —
• In MATLAB 6, the command my_method(subclass) invokes
@subclass/My_Method.
• In MATLAB 7, the same command invokes @baseclass/my_method
because it is an exact match.
On UNIX Platforms —
MATLAB 7 does the same as on Windows.
One File with an Inexact Match. Another situation that MATLAB now
handles differently involves just one function or model file that matches the
function being called:
H:\released\myTestFun.m
However, the name of this M-file does not match the called function
(mytestfun) in letter case.
On Windows Platforms —
• In MATLAB 6, calling the function mytestfun invokes
H:\released\myTestFun.m.
• In MATLAB 7, calling the function mytestfun invokes the same M-file but
also displays the following warning:
Function call mytestfun invokes inexact match
582
Programming, MATLAB Version 7 (R14)
H:\released\myTestFun.m.
On UNIX Platforms —
• In MATLAB 6, calling the function mytestfun results in an error.
• In MATLAB 7, calling mytestfun invokes H:\released/myTestFun.m and
generates the following warning:
Function call mytestfun invokes inexact match
H:/released/myTestFun.m.
Private Directory Names. Private functions must reside in a directory
named private that is one level down from the directory of any calling
function. As of this release, the directory name private is case sensitive on
Windows as it has always been on UNIX.
On Windows Platforms —
• In MATLAB 6, calling function myprivfun in an environment where only
a subdirectory named \PriVAte contains the M-file myprivfun.m invokes
\PriVAte\myprivfun without displaying a warning.
• MATLAB 7 does the same as MATLAB 6, except that it also displays the
following warning:
Wrong case spelling of 'private' as a directory name in
\released\PriVate\myprivfun.m.
On UNIX Platforms —
• In MATLAB 6, calling function myprivfun in an environment where only
a subdirectory named \PriVAte contains the M-file myprivfun.m results
in an error.
• In MATLAB 7, calling myprivfun in this same environment invokes
/PrivATe/myprivfun and also displays the following warning:
Wrong case spelling of 'private' as a directory name in
/released/PriVate/myprivfun.m.
583
Version 7 (R14) MATLAB® Software
Turning Off Warnings Caused by Case Mismatch
You can disable most warnings caused by case mismatch with the following
command:
warning off MATLAB:dispatcher:InexactMatch
To disable this warning for all of your MATLAB sessions, add this command
to your startup.m or matlabrc.m file.
If you continue to get case sensitivity warnings after entering this command,
you can disable a wider range of warnings with the following command:
warning off ...
MATLAB:dispatcher:CaseInsensitiveFunctionPrecedesExactMatch
Note This latter warning alerts you when, for case sensitivity reasons,
MATLAB may have selected a different M-file from the one you had intended
to run. It is recommended that you leave this warning enabled.
Differences Between Built-Ins and M-Functions
Removed; Can Affect Which Function MATLAB Selects
MATLAB implements many of its core functions as built-ins. In previous
releases of MATLAB, there have been several significant differences between
the way MATLAB handles built-in and M-file functions. As of this release,
MATLAB handles both types of functions the same. This change affects the
following:
• “Function Dispatching” on page 584
• “Return Value from the functions Function” on page 585
• “Output from the which Function” on page 585
Function Dispatching
MATLAB now dispatches both built-in and M-file functions according to the
same precedence rules, (see “Function Precedence Order” in the MATLAB
Programming documentation). In previous releases, subfunctions, private
functions, and class constructor functions took precedence over M-functions
584
Programming, MATLAB Version 7 (R14)
of the same name, but not over built-ins. In this release, built-in functions
follow the same rules given to M-functions, and thus are lower in precedence
than the three function types named above.
This change addresses a potential problem in that changes to the internal
implementation of MATLAB functions could potentially affect the operation of
your own M-code. For example, if a new version of MATLAB were to change
an internal function from being M-based to being built-in, the function in the
new version would now be subject to different precedence rules. If one of your
M-code modules had a subfunction with the same name as this function (now
obeying the built-in rules), then this subfunction would never be called.
This release resolves this potential conflict by using the same precedence
rules for both M-functions and built-ins.
Compatibility Considerations. If any of your programs have subfunctions,
private functions, or class constructor functions that have the same name as
a built-in function that has the same function scope, MATLAB now gives
precedence to the subfunction, private function, or constructor rather than
the built-in. If this is not corrected, you may find instances where your
program calls a function other than the one you had intended. You can avoid
such problems by renaming any functions that may conflict with a MATLAB
built-in function.
Return Value from the functions Function
The MATLAB functions function returns information about a function
handle such as the function name, type, and filename. In previous releases,
functions returned the filename for a built-in function as the string
'MATLAB built-in function'
In this release, MATLAB associates each built-in function with a placeholder
file that has a .bi extension (for example, reshape.bi for the built-in
reshape function).
Output from the which Function
The which function now displays the pathname for built-in functions, as well
as for overloaded functions when only the overloaded functions are available.
585
Version 7 (R14) MATLAB® Software
Warning on Naming Conflict
The following warning was added to identify the case when you first use a
name as a function and later use it as a variable:
Warning: File: D:\Work\MATLAB XL\theworks\my_yprime.m Line: 17
Column: 1 Variable 'getdata' has been previously used as a
function name.
(Type "warning off MATLAB:mir_warning_variable_used_as_function:
to suppress this warning.)
For example, this code generates such a warning:
X = i; % Calls the function i() to get sqrt(-1)
for i = 1:10 % uses i as a variable. This produces the warning.
... end
Change to How evalin Evaluates Dispatch Context
In Release 13 and earlier, the evalin function evaluated its input in the
specified workspace, but not the workspace’s corresponding dispatching
context. Hence, running the following example used to succeed, calling the
subfunction MySubfun but using the value of x from the base workspace:
function demo
evalin('base', 'MySubfun(x)')
function MySubfun(in)
disp(in)
When you call evalin in Release 14, MATLAB tries to find a function named
MySubfun that is accessible in the base workspace, i.e. at the command
prompt. Since MySubfun is a subfunction and therefore not in scope at the
command prompt, MATLAB errors, reporting that MySubfun is undefined.
Compatibility Considerations
There are two ways to change your existing code to work with this new
behavior. First, if your code only needs to get the value of the subfunction’s
inputs from the base workspace (as demo.m does above), and does not care
what context MySubfun is run in, then you can change your code to use evalin
only to get the values of the inputs from the base workspace, like this:
586
Programming, MATLAB Version 7 (R14)
function demo_workaround1
MySubfun(evalin('base', 'x'))
function MySubfun(in)
disp(in)
If, however, it is important that the subfunction itself be run in the context of
the base workspace, you can place a function handle to the subfunction in the
base workspace and then evaluate that:
function demo_workaround2
assignin('base', 'MySubfunHandle', @MySubfun);
evalin('base', 'MySubfunHandle(x)')
function MySubfun(in)
disp(in)
You can also substitute ’caller’ for ’base’ in the workaround code if your
original code uses evalin('caller', ...).
Summary of New Functions
These functions are new in this release.
Function
Description
addtodate
Modify a particular field of a date number
genvarname
Construct valid variable name from string
intmax
Return largest possible integer value
intmin
Return smallest possible integer value
intwarning
Control state of integer warnings
isfloat
Detect floating-point arrays
isinteger
Detect whether an array has integer data type
isscalar
Determine if item is a scalar
isstrprop
Determine the content of each element of a string
isvector
Determine if item is a vector
587
Version 7 (R14) MATLAB® Software
Function
Description
mmfileinfo
Get information about multimedia file
recycle
Set option to move deleted files to recycle folder
restoredefaultpath
Restore default search path
strtrim
Remove leading and trailing whitespace from
string
textscan
Read data from text file, convert and write to cell
array
xlswrite
Write matrix to a Microsoft Excel spreadsheet
New Function Type — Anonymous Functions
Anonymous functions give you a quick means of creating simple functions
without having to create M-files each time. You can construct an anonymous
function either at the MATLAB command line or from within another function
or script.
Refer to “Anonymous Functions” in the MATLAB Programming
documentation for more complete coverage of this topic. For more information
on anonymous functions, open the M-file anondemo.m in the MATLAB Editor
by typing
edit anondemo
Syntax
The syntax for creating an anonymous function from an expression is
fhandle = @(arglist) expr
where arglist is a comma-separated list of input variables, and expr is
any valid MATLAB expression. The constructor returns a function handle,
fhandle, that is mapped to this new function. Creating a function handle
for an anonymous function gives you a means of invoking the function. It
is also useful when you want to pass your anonymous function in a call to
some other function.
588
Programming, MATLAB Version 7 (R14)
Note Function handles not only provide access to anonymous functions. You
can create a function handle to any MATLAB function. The constructor uses
a different syntax: fhandle = @functionname (e.g., fhandle = @sin). To
find out more about function handles, see “Function Handles” in the MATLAB
Programming documentation.
You can use the function handle for an anonymous function in the same way
as any other MATLAB function handle.
A Simple Example
To create a simple function sqr to calculate the square of a number, use
sqr = @(x) x.^2;
To execute the function, type the name of the function handle, followed by any
input arguments enclosed in parentheses:
a = sqr(5)
a =
25
Since sqr is a function handle, you can pass it to other functions. The code
shown here passes the function handle for anonymous function sqr to the
MATLAB quad function to compute its integral from zero to one:
quad(sqr, 0, 1)
ans =
0.3333
Arrays of Anonymous Functions
To store multiple anonymous functions in an array, use a cell array.
See “Arrays of Anonymous Functions” in the MATLAB Programming
documentation.
Examples
You can find more examples of how to use anonymous functions in MATLAB
under “Examples of Anonymous Functions”.
589
Version 7 (R14) MATLAB® Software
New Function Type — Nested Functions
You can now define one or more functions within another function in
MATLAB. These inner functions are said to be nested within the function that
contains them. You can also nest functions within other nested functions.
Refer to “Nested Functions” in the MATLAB Programming documentation
for more complete coverage of this topic. For more information on nested
functions, open the M-file nesteddemo.m in the MATLAB Editor by typing
edit nesteddemo
Writing a Nested Function
To write a nested function, simply define one function within the body of
another function in an M-file. Like any M-file function, a nested function
contains any or all of the usual function components. In addition, you must
always terminate a nested function with an end statement:
function x = A(p1, p2)
...
function y = B(p3)
...
end
...
end
Characteristics of Nested Functions
Two characteristics unique to nested functions are
• A nested function has access to the workspaces of all functions inside of
which it is nested. A variable that has a value assigned to it by the primary
function can be read or overwritten by a function nested at any level within
the primary. Similarly, a variable that is assigned in a nested function can
be read or overwritten by any of the functions containing that function.
• When you construct a function handle for a nested function, the handle not
only stores the information needed to access the nested function; it also
stores the values of all variables shared between the nested function and
those functions that contain it. This means that these variables persist in
memory between calls made by means of the function handle.
590
Programming, MATLAB Version 7 (R14)
Examples
You can find examples of how to use nested functions in MATLAB under
“Examples of Nested Functions”.
Calling Private Functions From Scripts
You can now invoke a private function from a script, provided that the script
is called from another M-file function, and that the private function being
called by the script is within the scope of this M-file function.
New Calling Syntax for Function Handles; Replace
eval With New Syntax
You can now call functions by means of their related function handles using
standard calling syntax rather than having to use feval. When calling a
function using its handle, specify the function handle name followed by any
input arguments enclosed in parentheses.
For example, if the handle to a function was stored in variable h, you would
call the function as if the handle h were a function name:
h(arg1, arg2, ...)
For the parabola function shown here, construct a function handle h and call
the parabola function by means of the handle:
function y = parabola(a, b, c, x)
y = a*x.^2 + b*x + c;
parabHandle = @parabola;
parabHandle(1.3, .2, 30, 25)
When calling functions that take no input arguments, you must use empty
parentheses after the function handle:
parabHandle()
591
Version 7 (R14) MATLAB® Software
Compatibility Considerations
Using feval for the purpose of invoking functions via function handle is no
longer necessary and is, in fact, slower. However, for purposes of backward
compatibility, the use of feval to evaluate function handles is still supported
in this release.
Parenthesis notation on a nonscalar function handle means subscripting,
just as in Release 13, while the same notation on scalar function handles
means function call, as described above. Incompatibility can arise only if you
construct a scalar array of function handles and actually index it, necessarily
with an index of 1.
Arrays of Function Handles
Previous releases of MATLAB supported arrays of function handles. You
created such an array using the [] operator, and indexed into the array with
the () operator:
x = [@sin @cos @tan];
plot(feval(x(2), -pi:.01:pi));
In Release 14, MATLAB supports arrays of functions handles using cell
arrays. You create and index into a function handle array using the {}
operator:
x = {@sin @cos @tan};
plot(x{2}(-pi:.01:pi));
Compatibility Considerations
For purposes of backward compatibility, standard arrays of function handles
are still supported in this release.
Calling nargin and nargout with Built-In Functions
When you pass the name of a function to nargin or nargout, MATLAB
returns the number of declared inputs or outputs for that function. For
example, passing the function name 'normest' to nargin returns 2, (the
number of inputs declared in normest.m:
nargin('normest')
592
% normest is an M-function.
Programming, MATLAB Version 7 (R14)
ans =
2
In this release, you can also use this feature with MATLAB built-in functions.
The following use of nargin returned an error in previous versions of
MATLAB because norm is implemented as a built-in function. In this release,
nargin returns the number of inputs declared by the norm function:
nargin('norm')
ans =
2
% norm is a built-in function.
The same applies to nargout.
Comma Separators Not Required in Function
Declaration
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)
Compatibility Considerations
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)
getfield and setfield Not To Be Deprecated
There are no plans to remove the getfield and setfield functions from the
MATLAB language, as stated in the release notes for MATLAB Release 13.
isglobal Function To Be Discontinued
Support for the isglobal function will be removed in a future release of
MATLAB. In Release 14, invoking isglobal generates the following warning:
593
Version 7 (R14) MATLAB® Software
Warning: isglobal is obsolete and will be discontinued.
Type "help isglobal" for more details.
Recycle to Protect Files from Unwanted Deletion
To protect yourself from unintentionally deleting any files that you want
to keep, use the new recycle function to turn on file recycling. When file
recycling is on, MATLAB moves all files that you delete with the delete
function to either the recycle bin (on the PC or Macintosh) or a temporary
folder (on UNIX). When file recycling is off, any files you delete are actually
removed from the system.
You can turn recycling on for all of your MATLAB sessions using the
Preferences dialog box. (Select File > Preferences > General.) Under
the heading Default behavior of the delete function, select Move files
to the Recycle Bin.
bin2dec Ignores Space Characters
The bin2dec function now ignores any space (’ ’) characters in the input
string. Thus, the binary string '010 111' now yields the same result as
the string '010111'.
In Release 13, bin2dec interpreted space characters as zeros:
bin2dec('010 111')
ans =
39
In this release, bin2dec ignores all space characters:
bin2dec('010 111')
ans =
23
dbstop crashes Are Now Resolved
In previous versions, a MATLAB session would terminate prematurely when
attempting to execute certain P-code files if you had set a debugger breakpoint
in the function represented by that file. For example, an attempt to run Guide
would terminate your MATLAB session if you had used the dbstop function
to set a breakpoint in the corresponding M-file:
594
Programming, MATLAB Version 7 (R14)
dbstop in guide
guide
This bug has been fixed in this release enabling you to debug these files
successfully.
Bit Functions on Unsigned Integers
MATLAB bit functions now work on unsigned integers. Instead of using flints
(integer values stored in floating point) to do you bit manipulations, consider
using unsigned integers. See “Bit Functions Now Work on Unsigned Integers”
on page 560 in the MATLAB Mathematics release notes.
inmem Returns Path Information
The inmem function now returns not only the names of the currently loaded
M- and MEX-files, but the path and filename extension for each as well. Use
the -completenames option to obtain this additional information:
inmem('-completenames')
New Features for Nondouble Data Types
The section “New Nondouble Mathematics Features” on page 551 describes
new features affecting the nondouble (single and integer) data types. These
changes affect single and integer arithmetic operations, and also conversion
of single and double data types to integers.
Mathematic Operations on Logical Values
Most mathematic operations are not supported on logical values.
Accessing Cell and Structure Arrays Without deal
In many instances, you can access the data in cell arrays and structure fields
without using the deal function. Here is an example that reads each of the
cells of a cell array into a separate output:
C = {rand(3) ones(3,1) eye(3) zeros(3,1)};
Use either of the following to access the cells in C:
595
Version 7 (R14) MATLAB® Software
[a,b,c,d] = deal(C{:})
[a,b,c,d] = C{:}
Here is an example that reads each of the fields of a structure array into a
separate output:
A.name = 'Pat'; A.number = 176554;
A(2).name = 'Tony'; A(2).number = 901325;
Use either of the following to access the name field:
[name1,name2] = deal(A(:).name)
[name1,name2] = A(:).name
New Features in Regular Expression Support
This version of MATLAB introduces the following new features in regular
expression support:
• Multiple Input Strings — You can use any of the MATLAB regular
expression functions with cell arrays of strings as well as with single
strings. Any or all of the input parameters (the string, expression, or
replacement string) can be a cell array of strings.
• Selective Outputs — To select what type of data you want the regexp and
regexpi to return (string indices or text, token indices or text, or token
data by name) use one or more of the six qualifiers for these functions.
• Lookaround Operators — Lookahead and lookbehind operators enable you
to match a pattern only if it is preceded, or followed, by another pattern.
• New Logical Operators — New operators for grouping, inserting comments,
and finding alternative match patterns
• New Quantifiers — Lazy quantifiers match a minimum number of
characters in a string. Possessive quantifiers do not reevaluate parts of the
string that have already been evaluated
• Element Grouping — Group elements together using either (...) to group
and capture, or (?:...) for grouping alone
• Named Capture Grouping — Capture characters in a token and assign
a name to the token
596
Programming, MATLAB Version 7 (R14)
• Conditional Expressions — Process a string in different ways depending
on a stated condition
• New Character Representations — New symbolic representations such as
\e for escape, or \xN for a character of hexadecimal value N, are available
in this release.
• Default Tokenizing — The regexprep function now tokenizes by default.
There is no longer a 'tokenize' option
Refer to “Regular Expressions” on page 413 in the MATLAB Programming
documentation.
Functions that Use Regular Expressions
The who, whos, save, load, and clear functions now accept regular
expressions as input. This feature enables you to be more selective concerning
which variables they operate on.
For example, this statement saves to a MAT-file only those variables with
a name that either starts with the letters A or B, or contains ten or more
characters:
save('mydata.mat', '-regexp', '^[AB].', '.{10,}');
If the workspace contains the following four variables, two of the four meet
the requirements of the regular expression:
whos
Name
A_stats
X23456789
ab
longerVariableName
Size
10x5
1x1
3x1
1x4
Bytes
400
12
536
8
Class
double array
char array
struct array
char array
When you perform the save operation and then check the contents of the
MAT-file, you see that the variables with names that either start with A or
have at least ten characters were saved:
save('mydata.mat', '-regexp', '^[AB].', '.{10,}');
597
Version 7 (R14) MATLAB® Software
whos -file mydata.mat
Name
Size
A_stats
longerVariableName
10x5
1x4
Bytes
400
8
Class
double array
char array
Refer to the reference pages for these functions for more information and
examples.
Regular Expressions Accept String Vector; No Longer
Support Character Matrix Input
You can now pass a vector of strings in a cell array to any of the MATLAB
regular expression functions (regexp, regexpi, and regexprep).
Compatibility Considerations
Because this is the preferred method of passing a string vector, MATLAB no
longer supports using character matrices for this purpose.
Cell Array Support for String Functions
You can now pass a cell array of strings to the strfind function. MATLAB
searches each string in the cell array for occurrences of the pattern string,
and returns the starting index of each such occurrence.
Additional Class Output From mat2str
The statement str = mat2str(A, 'class') creates a string with the name
of the class of A included. This option ensures that the result of evaluating
str will also contain the class information.
Change the 16-bit integer matrix to a string that includes 'int16'. Next,
evaluate this string and verify that you get the same matrix that you started
with:
x1 = int16([-300 407 213 418 32 -125]);
A = mat2str(x1, 'class')
A =
598
Programming, MATLAB Version 7 (R14)
int16([-300 407 213 418 32 -125])
x2 = eval(A);
isa(x2, 'int16') && all(x2 == x1)
ans =
1
String Properties
Use the new isstrprop function to see what parts of a string or array of
strings are alphabetic, alphanumeric, numeric digits, hexadecimal digits,
lowercase, uppercase. white-space characters, punctuation characters,
contain control characters, or contain graphic characters.
For example, to test for alphabetic characters in a two-dimensional cell array,
use
A = isstrprop({'abc123def';'456ghi789'}, 'alpha')
A =
[1x9 logical]
[1x9 logical]
A{:,:}
ans =
1 1 1 0 0 0 1 1 1
0 0 0 1 1 1 0 0 0
Using strtok on Cell Arrays of Strings
You can now use the strtok function on a cell array of strings. When used
with a cell array of strings, strtok returns a token output that is also a cell
array of strings, each containing a token for its corresponding input string.
See the strtok reference page to see an example of how this works.
Colon Operator on char Now Returns a char
Applying the colon operator to inputs of type char now returns a result of
type char. For example,
'a':'g'
599
Version 7 (R14) MATLAB® Software
ans =
abcdefg
Compatibility Considerations
In previous releases, the same operation returned a result of type double.
You may need to change your code if it relies on type double being returned.
datestr Returns Date In Localized Format
The statement str = datestr(..., 'local') returns the date string in a
localized format. See the datestr reference page for more information.
Form and Locale for weekday
The weekday function now takes two new inputs that control the output
format. These arguments enable you to get a full or abbreviated day name,
and a local or US English output.
Freestyle Date String Format
When converting between serial date numbers, date vectors, and date strings
with the datenum, datevec, and datestr functions, you can specify a format
for the date string from the table shown on the datestr reference page.
Reading Date Values with xlsread; Conversion No
Longer Necessary
There are two changes that affect importing date information from Excel
with the xlsread function:
• “Date Information Returned as Cell Array of Char” on page 600
• “Conversion of Date Values Is No Longer Necessary” on page 601
Date Information Returned as Cell Array of Char
Prior to this release, xlsread imported date information from an Excel file
and returned the results as a double. In Release 14, xlsread returns this
information as a cell array containing data of class char. The reason for
600
Programming, MATLAB Version 7 (R14)
this is that MATLAB now imports Excel files using an Excel COM server.
Excel returns dates is as strings, and there is really no indication that what
is returned is a date.
Compatibility Considerations. You will need to change your program code
to accept a cell array of type char instead of an array of double when using
xlsread to import date information from Excel.
Conversion of Date Values Is No Longer Necessary
When reading date fields from a Microsoft Excel file using earlier versions of
MATLAB, it was necessary to convert the Excel date values into MATLAB
date values. This was necessary because Excel and MATLAB calculated date
values based on a different reference date.
With MATLAB 7.0, you no longer have to do this conversion because xlsread
now imports dates as strings rather than as numerical values.
For more information, see “Converting Dates”.
Compatibility Considerations. If your existing code converts Excel date
values to MATLAB values, you will need to remove this step so that you end
up with the correct results.
Comprehensive Function for Reading Text Files
The new textscan function reads data from an open text file into a cell array.
MATLAB parses the data into fields and converts it according to conversion
specifiers passed to textscan in the argument list.
The textscan function is similar to textread but differs from textread in
the following ways:
• The textscan function offers better performance than textread, making it
a better choice when reading large files.
• With textscan, you can start reading at any point in the file. Once the file
is open, (textscan requires that you open the file first), you can seek to any
position in the file and begin the textscan at that point. The textread
function requires that you start reading from the beginning of the file.
601
Version 7 (R14) MATLAB® Software
• Subsequent textscan operations start reading the file at the point where
the last textscan left off. The textread function always begins at the start
of the file, regardless of any prior textread.
• textscan returns a single cell array regardless of how many fields you
read. With textscan, you don’t need to match the number of output
arguments to the number of fields being read as you would with textread.
• textscan offers more choices in how the data being read is converted.
• textscan offers more user-configurable options.
New Inputs and Outputs to xlsread
The table below shows new input and output arguments to the xlsread
function. See the function reference for xlsread for more information. With
the exception of the basic input argument, these arguments are supported
only on computer systems capable of starting Excel as a COM server from
MATLAB.
New Input
Arguments
Description
-1
Opens the Excel file in an Excel window, enabling you
to interactively select the worksheet to be read and
the range of data to import from the worksheet.
range
Reads data from the rectangular region of a worksheet
specified by range.
basic
Imports data from the spreadsheet in basic import
mode.
New Output
Argument
rawdata
Description
Returns unprocessed cell content in a cell array. This
includes both numeric and text data.
New Inputs and Syntax for dlmwrite
The dlmwrite function now has several new input arguments plus an optional
attribute-value format in which to enter these arguments. You can now enter
602
Programming, MATLAB Version 7 (R14)
input arguments to dlmwrite in an attribute-value format. This format
enables you to specify just those arguments that you need and omit any
others. This new syntax for dlmwrite is
dlmwrite('filename', M, attribute1, value1, ...
attributeN, valueN)
The former syntax for dlmwrite is still supported for arguments that were
available in earlier versions of MATLAB.
The table below shows new input arguments to the dlmwrite function. You
must specify these new arguments using the attribute-value format. See the
dlmwrite function reference for more information.
Attribute
Value
delimiter
Delimiter string to be used in separating matrix
elements
newline
Character(s) to use in terminating each line
roffset
Offset, in rows, from the top of the destination file
to where matrix data is to be written
coffset
Offset, in columns, from the left side of the
destination file to where matrix data is to be
written
precision
Numeric precision to use in writing data to the file
For example, to export matrix M to file myfile.txt, delimited by the tab
character, and using a precision of six significant digits, type
dlmwrite('myfile.txt', M, 'delimiter', '\t', 'precision', 6)
Change in Output from xlsfinfo
xlsfinfo now returns the names or all worksheets in an Excel file instead of
just the ones with numbers in them (as in Release 13).
603
Version 7 (R14) MATLAB® Software
Importing Complex Arrays
The csvread, dlmread, and textscan functions import any complex number
as a whole into a complex numeric field, converting the real and imaginary
parts to the specified numeric type. Valid forms for a complex number are
Form
Example
–<real>–<imag>i|j
5.7-3.1i
–<imag>i|j
-7j
Using imread to Import Subsets of TIFF Images
When using the imread function with the 'PixelRegion' parameter, you
can now read in portions of an image stored in TIFF format. Specify a cell
array containing two vectors, ROWS and COLS, for the value of this parameter.
Each vector can either be a two-element vector specifying the extent of the
region, [START STOP], or a three-element vector that enables downsampling,
[START INCREMENT STOP].
When used with tiled images, 'PixelRegion' subsetting can improve memory
usage and performance because it only reads in the tiles that encompass the
region. For example, in the following figure, if you specify the region defined
by the box, imread would only read in tiles 1, 2, 4, and 5.
604
Programming, MATLAB Version 7 (R14)
Getting Information about Multimedia Files
MATLAB now includes a function, named mmfileinfo, that returns
information about the contents of a multimedia file. The file can contain
audio data, video data, or both.
This function is only available on Windows platforms.
All-Platform Audio Recording and Playback
The MATLAB audiorecorder and audioplayer functions can now be used
on Windows and UNIX platforms. These functions were previously only
available on Windows systems.
Note The audiorecorder and audioplayer objects are now implemented as
MATLAB objects on all platforms. The methods supported by these objects
are overloaded functions. You must use standard MATLAB function calling
syntax to call methods of these objects; you cannot use dot notation.
605
Version 7 (R14) MATLAB® Software
FTP File Operations
From within MATLAB, you can connect to an FTP server to perform remote
file operations. For more information, see the ftp reference page.
Web Services (SOAP)
MATLAB can now consume Simple Object Access Protocol-based (SOAP) Web
services with the createClassFromWSDL function. For more information, see
“Using Web Services with MATLAB” in the online documentation.
64-Bit File Handling on MacIntosh
The release notes for MATLAB Release 13 should have included MacIntosh in
the list of those platforms that support 64-bit file handling. This support is
available on the following platforms:
• Windows
• Solaris
• Linux 2.4.x
• HP-UX 11.0, 9000/785
• Macintosh
Changes to Error Message Format
The last two lines of MATLAB error messages have changed for Release 14.
Error messages now
• Display functions and subfunctions differently than in R13.
• Display nested functions.
• Call out the error in a string that you can use as input to other functions,
like dbstop.
• Have a hot link to the source of the error.
Each of these changes is discussed below. Examples show the errors
generated by both the previous release (V6.5) and current release (7.0) of
MATLAB for the purpose of comparison.
606
Programming, MATLAB Version 7 (R14)
Display of Functions and Subfunctions
MATLAB now calls out the source of the error using a consistent format. One
of the features of this format is that you can place the string of the message
into other MATLAB commands. See “Using the Error Message String as
Input to Other Functions” on page 608.
Errors Generated by the Primary Function. Errors generated by the
primary function of an M-file are displayed as shown below. In version 7.0,
the path is not shown in most cases (private functions are one exception).
Filename extension is also not shown. The failing line number is shown on
third line.
In MATLAB V6.5 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> B:\MATLAB_V70\work\errmsgtest.m
On line 11 ==> strcmp('aa','bb','cc');
In MATLAB V7.0 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> errmsgtest at 11
strcmp('aa','bb','cc');
Errors Generated by a Subfunction. Errors generated by a subfunction
of an M-file are displayed in the previous release and current release of
MATLAB as shown below. Comments for primary functions apply here as
well. Also, the name of the failing subfunction follows the > character instead
of being put in parentheses.
In MATLAB V6.5 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> B:\MATLAB_V70\work\errmsgtest.m (subFun1)
607
Version 7 (R14) MATLAB® Software
On line 17
==> strcmp('aa','bb','cc');
In MATLAB V7.0 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> errmsgtest>subFun1 at 17
strcmp('aa','bb','cc');
Error Messages Display Nested Functions
This example shows an error that comes from a nested function (nestFun2)
called by another nested function (nestFun1). It uses the following syntax,
where the > character follows the name of the primary function and precedes
the names of any nested functions.
fun>nestfun1/nestfun2/etc at lineno.
In MATLAB V6.5 —
Nested functions are not supported prior to version 7.0.
In MATLAB V7.0 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> errmsgtest>nestFun1/nestFun2 at 6
strcmp('aa','bb','cc');
Using the Error Message String as Input to Other Functions
You can copy the text of the line that calls out the source of an error and
use this string as input to some of the MATLAB debugging functions. The
example shown below uses the string in a call to the dbstop function.
Copy the text that begins after
Error in ==>
608
Programming, MATLAB Version 7 (R14)
In MATLAB V6.5 —
This feature is not supported prior to version 7.0.
In MATLAB V7.0 —
??? Error using ==> strcmp
Too many input arguments.
Error in ==> errmsgtest>nestFun1/nestFun2 at 6
strcmp('aa','bb','cc');
Copy and paste text of this error message into the dbstop command:
dbstop errmsgtest>nestFun1/nestFun2 at 6
Hot Link to the Source of an Error
Error messages now contain a blue-underlined hot link to the failing line
of the M-file being executed.
Compatibility Considerations
If any of your programs rely on specific text in the types of error messages
described here, you may have to modify your program code.
nargchk Has a New Format for Error Messages
When the nargchk function detects an error condition, it returns information
on the error in either a string or a MATLAB structure. Use one of these two
command syntaxes to specify which format to return. If neither is specified,
nargchk returns a string:
msgstring = nargchk(minargs, maxargs, numargs, 'string')
msgstruct = nargchk(minargs, maxargs, numargs, 'struct')
The return structure has two fields: the message string, and a message
identifier . When too few inputs are supplied, these fields are
message: 'Not enough input arguments.'
identifier: 'MATLAB:nargchk:notEnoughInputs'
609
Version 7 (R14) MATLAB® Software
When too many inputs are supplied, the structure fields are
message: 'Too many input arguments.'
identifier: 'MATLAB:nargchk:tooManyInputs'
Enabling and Disabling Warning Messages
The following message, which MATLAB appended to all warning messages in
the previous release, is no longer displayed.
(Type "warning off <msgid:msgstr>" to suppress this warning.)
Use the off and on options of the warning function to control the display
of all or selected warnings. This example disables a selected warning, and
then enables all warnings:
% All warnings are enabled by default.
A = 5/0;
Warning: Divide by zero.
% Disable the most recent warning
[msgstr msgid] = lastwarn;
warning('off', msgid);
% Try it again. This time there is no warning.
A = 5/0;
% Enable all warnings
warning('on', 'all')
% Verify that the warning is reenabled.
A = 5/0;
Warning: Divide by zero.
Catching Ctrl+C in try-catch Statements
In previous releases of MATLAB, typing Ctrl+C while executing the try part
of a try-catch statement resulted in the program branching to the catch part
of that statement. In this release, typing Ctrl+C is purposely not caught by
try-catch statements.
610
Programming, MATLAB Version 7 (R14)
The reason for this change is that, under certain circumstances, this behavior
in try-catch statements was found to adversely affect internal MATLAB code.
In these cases, this resulted in MATLAB code catching the Ctrl+C rather
than responding appropriately to it by terminating the current operation.
MATLAB Performance Acceleration
Release 13 introduced a new performance acceleration feature built into
MATLAB. Enhancing performance in MATLAB is an ongoing development
project that continues to show significant improvements in the performance of
MATLAB programs.
The Performance Acceleration documentation written for Release 13 included
suggestions on specific techniques to make the most of this feature. In
this release, many of those techniques are no longer necessary. This
documentation has been replaced with more general suggestions on how to
improve the performance of your programs.
Assignment Error Removed
In versions of MATLAB prior to V7.0 (R14), certain types of assignment
generate an error. The error occurs if you attempt to assign a vector of one
dimension (e.g., a row vector) to a vector of a different dimension (e.g., a
column vector) . The vector being assigned to can also be a series of elements
along one dimension (e.g., row or column) of an array).
For example, running the following two statements in MATLAB Version 7.3.0
(R2006b) results in the error shown here:
A = eye(5,5);
A(:,1) = [1 2 3 4 5]
??? In an assignment A(:,matrix) = B, the number of elements in the sub
of columns in B must be the same.
Starting with Version 7.0 (R14), you no longer see this error under these
circumstances. Here is the same example run in MATLAB Version 7.0:
A = eye(5,5);
A(:,1) = [1 2 3 4 5]
A =
1
0
0
0
0
611
Version 7 (R14) MATLAB® Software
2
3
4
5
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
This new behavior is not a bug. It results from the fact that MATLAB 7.0
(R14) ignores singleton dimensions when performing dimension checks during
assignment. This greatly simplifies the use of N-dimensional matrices.
Compatibility Considerations
If your program code depends in any way on this error being thrown under
the circumstances described above, you might need to modify it to run under
MATLAB versions R14 and higher.
“Using MATLAB” Documentation Is Now Three Books
Due to the increasing size of the printed “Using MATLAB” manual, we have
divided it into three separate printed books in version 7.0 to make it more
manageable. The titles for these books (and their corresponding headings
in the MATLAB Help Browser) are
• Desktop Tools and Development Environment
• Mathematics
• Programming
The online structure of this documentation is very similar to what it has been
in previous releases, although some topics are now covered more thoroughly.
We hope that you find this new format easier to use.
612
Graphics and 3-D Visualization, MATLAB® Version 7 (R14)
Graphics and 3-D Visualization, MATLAB Version 7 (R14)
This version introduces the following new features and changes:
• “Plotting Tools” on page 613
• “Code Generation” on page 614
• “Data Exploration Tools” on page 614
• “Annotation Features” on page 614
• “Plot Objects” on page 615
• “Group Objects” on page 617
• “Linking Graphics Object Properties” on page 617
• “New Behavior for Hold Command” on page 617
• “Enhancements to findobj” on page 617
• “New Ancestor Function Returns Object’s Ancestry” on page 617
• “New Axes Properties” on page 618
• “New Figure Properties” on page 618
• “New Root Object Property” on page 619
Plotting Tools
If you are using the Help browser, watch the new Plotting Tools video demo
for an overview of the major functionality.
The following list links to new or redesigned plotting tool features.
• “Anatomy of a Graph” — figure toolbars that provide data exploration,
plot editing, and annotation tools
• Interactive Plotting Tools — overview of plotting tools
-
Figure Palette
Plot Browser
Property Editor
613
Version 7 (R14) MATLAB® Software
Related functions:
• plottools
• figurepalette
• plotbrowser
• propertyeditor
Code Generation
You can save a graph as an M-file that contains the code to regenerate the
graph. See “Generating a MATLAB File to Recreate a Graph” for more
information.
Data Exploration Tools
The following list links to the documentation for the data exploration tools.
• Data Cursor — displaying data values interactively
• Zooming — 2-D and 3-D zoom tools
• Panning — repositioning you view of the graph
• Rotate 3D — interactive rotation of 3-D views
• Camera Toolbar — mouse-controlled 3-D view manipulation.
Annotation Features
The following list links to the documentation for annotation features and
properties of the annotation objects.
• Overview of annotation features
• Rectangles and ellipses
-
Rectangle properties
Ellipse properties
• Textbox annotations
-
614
Textbox properties
Graphics and 3-D Visualization, MATLAB® Version 7 (R14)
• Lines and Arrows
-
Line properties
Arrow properties
Textarrow properties
Doublearrow properties
• Adding a Colorbar to a graph — new positioning options and colormap
modification.
colorbar — new command options
• Adding a legend to a graph — new positioning and appearance options
legend — new command options
• Pinning — attaching annotation objects to a point in the figure
• Aligning and Distributing graphics objects
See the annotation function for information on programmatic access to
annotation objects.
See “Annotation Objects” for an overview of this type of graphics object.
Plot Objects
Plot Objects are composite graphics objects that simplify the modification
of graphs that employ them. The following list links to reference pages for
modified graphing functions and to property descriptions of the new plot
objects.
See “Plot Objects” for an overview of this type of graphics object.
Functions That Use Plot Objects
• area
• bar
• contour
• errorbar
615
Version 7 (R14) MATLAB® Software
• plot, plot3, loglog, semilogx, semilogy
• quiver, quiver3
• scatter, scatter3
• stairs
• stem, stem3
• surf, and mesh group
Note that all of the above functions have a 'v6' optional argument that
causes each function to return the core graphics objects that were created in
previous releases. See the reference pages for more information.
Plot Objects
• areaseries
• barseries
• contourgroup
• errorbarseries
• lineseries
• quivergroup
• scattergroup
• stairseries
• stemseries
• surfaceplot
Refreshing Data Source Properties
The refreshdata function enables you to take advantage of the XDataSource,
YDataSource, and ZDataSource plot objects properties to update graph data
when workspace variables change values.
See “Example — Specifying a Data Source”in the MATLAB Graphics
documentation for more information.
616
Graphics and 3-D Visualization, MATLAB® Version 7 (R14)
Group Objects
Group objects enable you treat a number of objects as one, with respect to
certain properties.
See “Group Objects” on page 617 for an overview of this type of graphics object.
Group Object Functions
• hggroup
• hgtransform
• makehgtform
Linking Graphics Object Properties
You can link the corresponding properties of graphics objects so that changing
any one object’s properties makes the same change to all the linked objects.
See linkprop and linkaxes for more information.
New Behavior for Hold Command
The hold command has a new option all. This option holds the plot and
the current line color and line style so that subsequent graphing commands
do not reset the ColorOrder or LineStyleOrder property values to the
beginning to the list.
Enhancements to findobj
The findobj function now supports logical operators and regular expressions.
See the findobj reference page for more information.
New Ancestor Function Returns Object’s Ancestry
The ancestor function enables you to determine an object’s direct parent,
as well as its complete ancestry. This is particularly useful when you want
to determine whether an object is contained in a uipanel or hggroup, for
example, and need the handle of the container object or the top-level figure.
617
Version 7 (R14) MATLAB® Software
New Axes Properties
You can control the behavior of an axes within a resized figure using the
following new axes properties.
• OuterPosition — The boundary of the axes including the axis labels,
title, and a margin. For figures with only one axes, this is the interior
of the figure.
• ActivePositionProperty — Specifies whether to use the OuterPosition
or the Position property as the size to preserve when resizing the figure
containing the axes.
• TightInset — The margins added to the width and height of the Position
property to include text labels, title, and axis labels.
See “Automatic Axes Resize” for more information.
New Figure Properties
There are three new figure properties described below.
Figure KeyPressFcn Property
The figure KeyPressFcn property now supports an event structure that
returns information about the key press event. See the KeyPressFcn
description for more information.
DockControls and WindowStyle Properties
Figures now have a DockControls property that determines if the Desktop
menu appears on the figure. Setting dockable to on causes the menu to be
displayed, the default setting of off prevents the menu from being displayed.
You can always dock and undock the figure by setting the figure WindowStyle
property.
Note that, depending on your preference settings, the figure might first be
grouped into a Document window, which can then be docked in the Desktop.
See “Docking Figures in the Desktop” for more information.
618
Graphics and 3-D Visualization, MATLAB® Version 7 (R14)
New Root Object Property
The MonitorPositions property enables you to get the positions (width,
height, and location) of multiple monitors connected to your computer.
New Dialog for Exporting Figures
You can export MATLAB figures to a variety of standard file formats using
the Export Setup dialog. To display the dialog, select Export Setup from
the figure File menu.
Export Setup provides easy access to the graphics properties that affect
exported figures. For example, it enables you to control the size of the figure,
the font size and type, whether to use line styles or solid lines, and so on.
You can save your own export setting as an export style, or you can use
predefined options optimized for Microsoft PowerPoint and Microsoft Word.
The following picture shows the major components of the Export Setup dialog.
619
Version 7 (R14) MATLAB® Software
Compatibility Considerations
Plotting Tools Not Working on Macintosh Platform
The plotting tools not supported on the Macintosh platform. This means the
Figure Palette, Plot Browser, and Property Editor do not work these platforms.
To use the MATLAB 6 Property Editor, see the propedit command.
Using -nojvm Option Prevents Plotting Tools Use
If you use the -nojvm option when starting MATLAB, the plotting tools are
not available.
620
Graphics and 3-D Visualization, MATLAB® Version 7 (R14)
MATLAB 6 Version Property Editor
The MATLAB 6 Property Editor is being replaced by a new Property Editor,
which is available in this release. However, you can still access the MATLAB
6 Property Editor by issuing the following command.
propedit(object_handle,'v6')
Without the v6 argument, propedit displays the new Property Editor. See
the propedit function for more information. Note that the Property Editor
might not work with all objects.
Cannot Dock Figures on Macintosh Platform
You cannot dock figures in the Desktop, because MATLAB uses native figure
windows on the Macintosh platform.
Not All Macintosh System Fonts Are Available
MATLAB figures do not support the same fonts as native Macintosh
applications. Use the uisetfont functions to see which fonts are available
in MATLAB.
621
Version 7 (R14) MATLAB® Software
Creating Graphical User Interfaces (GUIs), MATLAB Version
7 (R14)
This version introduces the following new features and changes:
• “New Container Components” on page 622
• “ActiveX Controls” on page 623
• “New Toolbar Component” on page 623
• “Menu Editor Enhancements” on page 624
• “Layout Resize Behavior” on page 624
• “Key Press Detection” on page 625
• “Edit Text Box Scroll Bar” on page 625
• “Setting Uicontrol Focus” on page 625
• “Multiple Selection in uigetfile” on page 626
• “Program Suspension Time-Out” on page 626
• “Standard Dialog Box Push Buttons” on page 626
• “New Syntax for uigetfile and uiputfile” on page 626
• “Frames Not Available in GUIDE Layout Editor” on page 627
New Container Components
MATLAB 7.0 introduces two new container components,
• Panel — Groups components
• Button group — Groups components and manages exclusive selection
behavior for radio buttons and toggle buttons.
These components are available in the GUIDE Layout Editor and via the
functions uipanel and uibuttongroup.
A container component can be the child of a figure or another container. In
general, containers can have as children the same components as figures,
including other containers. However, they cannot have menu bars, toolbars,
622
Creating Graphical User Interfaces (GUIs), MATLAB Version 7 (R14)
or ActiveX controls as children. The Position property of the child of a panel
or button group is interpreted relative to the panel or button group. If you
move the panel or button group, the components it contains automatically
move with it and maintain their positions.
Panel properties and button group properties enable you to control the color,
size, border, and position of the panel or button group, assign a title, and
specify a context menu. In general, panels and button groups have many of
the same properties as uicontrol objects.
For information about working with panels and button groups in GUIDE, see
the following topics in the Creating Graphical User Interfaces collection of
the MATLAB documentation.
Compatibility Considerations
You can export a GUI that contains a panel or button group from GUIDE to a
single M-file that does not require a FIG-file. However, you will not be able to
run that M-file in MATLAB versions earlier than 7.0.
ActiveX Controls
GUIDE now enables you to insert an ActiveX control into your GUI if you
are running MATLAB on Microsoft Windows. When you drag an ActiveX
component from the component palette into the layout area, GUIDE displays
a dialog in which you can select any registered ActiveX control on your
system. When you select an ActiveX control and click Create, the control
appears as a small box in the Layout Editor. You can then program the
control to do what you want it to.
See “Creating COM Objects” in the online MATLAB documentation and
ActiveX Controls in the GUIDE documentation to learn more about ActiveX
controls.
New Toolbar Component
A new function, uitoolbar, enables you to add a toolbar to a figure. You can
add your own pushtools and toggletools to the toolbar with the uipushtool
and uitoggletool functions.
623
Version 7 (R14) MATLAB® Software
Uipushtool properties enable you to provide a callback that responds to a
mouse click. Uitoggletool properties enable you to provide callbacks that
respond to the tool being set on, off, or toggled to either position. Properties
for both uipushtools and uitoggletools provide for tooltip strings, separators,
and truecolor images to display on the tools. In general, uitoolbar,
uipushtool, and uitoggletool objects have many of the same properties
as uicontrol objects.
Menu Editor Enhancements
The GUIDE Menu Editor now enables you to:
• Choose a keyboard accelerator for a menu item from a pop-up menu.
• Set an item’s Enabled property on or off when the menu is first opened. If
the property value is off, the item appears dimmed and the user cannot
select it.
• Open the Property Inspector where you can change all uimenu properties.
• Display the callback subfunction in an editor. If the callback does not yet
exist, GUIDE creates it before displaying it.
The Menu Editor is now better synchronized with other GUIDE tools:
• Property changes made in the Menu Editor or in the Property Inspector are
immediately reflected in the other.
• uimenu objects in the Menu Editor now also appear in the Object Browser.
If you select a uimenu object in either, it is automatically selected in the
other.
• If a component is selected in the Layout Editor and you select a menu item
in the Menu Editor, the component is deselected in the Layout Editor.
See Menu Editor in the MATLAB documentation for more information.
Layout Resize Behavior
In the GUIDE Layout Editor, components you have placed in the layout
area now maintain their visual position relative to the upper left corner of
their parent container (figure, panel, or button group) when you resize the
624
Creating Graphical User Interfaces (GUIs), MATLAB Version 7 (R14)
container in the Layout Editor. However, the values of the Position property
are determined relative to the lower left corner, and these values will change
accordingly when you increase or decrease the height of the container.
Key Press Detection
A new uicontrol callback property, KeyPressFcn, specifies a key press
callback function with which you can detect a key press when the callback’s
uicontrol object has focus. If no uicontrol has focus, the figure’s key press
callback function, if any, is invoked. This property is available in the
uicontrol function and in GUIDE.
If you specify the KeyPressFcn property as an M-file, the callback routine can
query the figure’s CurrentCharacter property to determine what particular
key was pressed and ,thereby, limit the callback execution to specific keys.
If you specify the KeyPressFcn property as a function handle, the callback
routine can retrieve information about the key that was pressed from its
eventdata structure argument.
As an example, you can use this property to enable a user to press Enter,
rather than the space bar, after giving focus to a uicontrol push button. Use
the push button’s key press callback function to determine if the user pressed
the Enter key. If it was the Enter key, call the push button callback.
See the Uicontrol Properties for more information.
Edit Text Box Scroll Bar
For uicontrol editable text fields, i.e. the Style property is set to 'edit',
if Max-Min>1, then multiple lines are allowed. For multi-line edit boxes, a
vertical scroll bar enables you to scroll the text. You can also use the arrow
keys to scroll.
Setting Uicontrol Focus
The uicontrol function now enables you to transfer focus programmatically
to a specified uicontrol object. The syntax uicontrol(uich) transfers focus
to the uicontrol object with handle uich.
625
Version 7 (R14) MATLAB® Software
Multiple Selection in uigetfile
The uigetfile function can now create a dialog that enables the user to
select and retrieve multiple files using the Shift and Ctrl keys. You can
turn this capability on or off using the new 'MultiSelect' parameter. The
default setting is off.
Program Suspension Time-Out
A new uiwait argument, timeout, enables you to specify the number of
seconds after which program execution will resume, unless uiresume is called
first or the specified figure is deleted. For example,
uiwait(h,5)
causes the suspended program to resume execution, if it has not already,
after five seconds.
Standard Dialog Box Push Buttons
For standard dialog boxes with more than one uicontrol push button, you
can now give focus to another button while retaining the default button.
Focus is denoted by a border or a dotted border, respectively, in UNIX and
Microsoft Windows. The default button has a shadow.
In such a case, if the user presses the space bar, the button with focus gets
the key press and can choose to execute its own callback or the callback of the
default button. If the user presses Enter, the default push button gets the
key press and its callback executes. This code provides an example.
ButtonName=questdlg('What is your wish?', ...
'Genie Question', ...
'Food','Clothing','Money','Money')
New Syntax for uigetfile and uiputfile
The uigetfile and uiputfile syntax that enables you to position dialog
boxes that are used to retrieve and save files is changed. The new syntaxes
are uigetfile('FilterSpec','DialogTitle','Location',[x y]) and
uiputfile('FilterSpec','DialogTitle','Location',[x y]). Previously,
the syntaxes were, uigetfile('FilterSpec','DialogTitle',x,y) and
uiputfile('FilterSpec','DialogTitle',x,y)
626
Creating Graphical User Interfaces (GUIs), MATLAB Version 7 (R14)
Compatibility Considerations
You are encouraged to change to the new uigetfile and uiputfile syntax.
The earlier syntaxes continue to be valid but may be removed in a later
release.
Frames Not Available in GUIDE Layout Editor
The frame component no longer appears in the GUIDE Layout Editor
component palette. It has been replaced by the panel and button group
components. See “New Container Components” on page 622 for information
about these new components.
Compatibility Considerations
GUIDE continues to support frames in those GUIs that contain them, but it is
recommended that you replace them with panels or button groups.
627
Version 7 (R14) MATLAB® Software
External Interfaces/API, MATLAB Version 7 (R14)
New features and changes introduced in this version are organized by these
topics:
• “Importing and Exporting” on page 628
• “Microsoft® ActiveX and COM Interface” on page 629
• “MATLAB Interface to Sun Java Programming Language” on page 636
• “General Features” on page 637
Importing and Exporting
Saving Character Data with Unicode Encoding
The save function now saves character data to a MAT-file using Unicode
character encoding by default. You can use your system’s default character
encoding scheme instead by specifying the -v6 option with save.
Compatibility Considerations. MAT-files saved in MATLAB version 7.0
without using the new -v6 flag will not be readable in previous versions of
MATLAB.
Saving Data in Compressed Format
The save function now saves data to a MAT-file in a compressed format by
default.
Large File I/O for MEX-Files
MATLAB supports the use of 64-bit file I/O operations in your MEX-file
programs. This enables you to read and write data to files that are up to
and greater than 2 GB (2^31-1 bytes). Note that some operating systems or
compilers may not support files larger than 2 GB.
See “Large File I/O” in the External Interfaces documentation for more
information.
628
External Interfaces/API, MATLAB® Version 7 (R14)
Microsoft ActiveX and COM Interface
Automatic Registration of Automation Server on Installation
When installing previous versions of MATLAB, system administrators
also had to run MATLAB at least once on each machine to register the
Automation server. In MATLAB 7.0, the MATLAB installation software does
the Automation server installation for you.
Support for Multiple COM Type Libraries
MATLAB now fully supports importing additional type libraries from within
an IDL file. Any COM object that depends on an imported type library is
now handled correctly.
COM Interface Supports Custom Interfaces
MATLAB now supports custom interfaces to a server component in
configurations where MATLAB is the client controlling an ActiveX control,
or an in-process or out-of-process server. For those COM components that
implement one or more custom interfaces, you can list the interfaces in
MATLAB using the new interfaces function:
h = actxserver('ComponentA.CustomObject')
h =
COM.componenta.customobject
customlist = interfaces(h)
customlist =
ICustomObject1
ICustomObject2
Once you select the custom interface that you want, use the invoke function
to get a handle to it:
c1 = invoke(h, 'ICustomObject1')
c1 =
Interface.componenta_Type_Library.ICustomObject1_Interface
You can now use this handle with most of the COM client functions to access
the properties and methods of the object through this custom interface. For
629
Version 7 (R14) MATLAB® Software
example, to list the methods available through the ICustomObject1 interface,
use
invoke(c1)
Add = double Add(handle, double, double)
CustomMethod1 = HRESULT CustomMethod1(handle, int32)
CustomMethod2 = HRESULT CustomMethod2(handle, int32)
TripleAdd = [double, double] TripleAdd(handle, double, double)
method3 = [string, int32, string, string] method3(
handle, int16, int32, double, string)
outin = [double, double, double, double] outin(
handle, double, double)
strings = string strings(handle, string)
You can read more about this feature in the section, “Getting Interfaces to the
Object” in the External Interfaces documentation.
COM Data Type Support for Scripting Languages
In previous versions of MATLAB, a COM client program written in VBScript
could not retrieve numeric data from or write data to the workspace of a
MATLAB client. This was because VBScript does not support the SAFEARRAY
data type used by MATLAB to pass numeric data to and from the server
workspace using the GetFullMatrix and PutFullMatrix functions.
Release 14 adds two new functions, GetWorkspaceData and
PutWorkspaceData, that pass data using the variant data type, a type that
is supported by VBScript. You can use these new functions to pass either
numeric or string data to any workspace in the COM server running MATLAB.
Refer to “Exchanging Data with the Server” in the External Interfaces
documentation.
Additional ProgIDs for Latest MATLAB Version
There are three additional COM programmatic identifiers (ProgIDs) in
MATLAB 7.0:
MATLAB.Autoserver
MATLAB.Autoserver.Single
MATLAB.Autoserver.7
630
External Interfaces/API, MATLAB® Version 7 (R14)
Using any of these identifiers with the actxserver function guarantees that
the MATLAB server you create always runs the latest version of MATLAB
(version 7.0).
Note These new ProgIDs do not replace the MATLAB.Application identifier
used in previous versions of MATLAB. You can continue using this ProgID,
but there is no guarantee that actxserver will create a server running
MATLAB 7.0.
Connecting to an Existing MATLAB Server
Instead of having to create new instances of a MATLAB server, clients can
connect to an existing MATLAB automation server using the GetObject
command. This sample Microsoft® Visual Basic® program connects to a
running MATLAB automation server, returning a handle h to that server. It
then executes a simple plot command in the server:
Dim h As Object
' Call GetObject (omit first argument).
Set h = GetObject(, "matlab.application")
' Handle h should be valid now. Test it by calling Execute
h.Execute ("plot([0 18], [7 23])")
Graphical Interface to Listing Available ActiveX Controls
The actxcontrollist function enables you to see what COM controls are
currently installed on your system. Type
list = actxcontrollist;
and MATLAB returns a list of each control, including its name, programmatic
identifier (or ProgID), and filename, in the output cell array.
Refer to “Listing Installed Controls” in the External Interfaces documentation.
631
Version 7 (R14) MATLAB® Software
Graphical Interface to Creating ActiveX Controls
The simplest way to create a control object is to use the actxcontrolselect
function. This function displays a graphical interface that lists all controls
installed on the system and creates the one that you select from the list.
The actxcontrolselect interface has a selection panel at the left of the
window and a preview panel at the right. Click on one of the control names
in the selection panel to see a preview of the control displayed. (If MATLAB
cannot create the control, an error message is displayed in the preview panel.)
Select an item from the list and click the Create button.
Refer to “Creating Control Objects Using a GUI” in the External Interfaces
documentation.
New Functions for the MATLAB COM Interface
There are five new COM client functions.
632
External Interfaces/API, MATLAB® Version 7 (R14)
Function
Description
actxcontrollist
List all currently installed ActiveX controls
actxcontrolselect
Display graphical interface for creating an ActiveX
control
interfaces
List custom interfaces to a COM server
iscom
Determine if input is a COM or ActiveX object
isinterface
Determine if input is a COM interface
There are three new COM server functions. When invoked by a MATLAB or
Visual Basic® client, these functions execute in the server associated with the
specified handle parameter.
Function
Description
Feval
Evaluate MATLAB function call in the server
GetWorkspaceData
Get data from server workspace
PutWorkspaceData
Store data in server workspace
See the function reference pages in the External Interfaces Reference
documentation for more information.
COM Interface Supports Dot Syntax in Commands
You can now use a simpler form of syntax when invoking either MATLAB
COM functions or methods belonging to COM objects. In this dot syntax (as it
is referred to in the MATLAB documentation), you specify the object name, a
dot (.), and then the name of the function or method you are calling. Enclose
any input arguments in parentheses after the function name. Specify output
arguments to the left of the equals sign:
outputvalue = object.function(arg1, arg2, ...)
For example, Release 13 syntax for invoking the addproperty function on a
COM object with handle h was
invoke(h, 'addproperty', 'Position');
633
Version 7 (R14) MATLAB® Software
You can now perform the same operation using
h.addproperty('Position');
The get and set operations are even simpler:
** R13 SYNTAX **
x = get(h, 'Radius');
set(h, 'Radius', 50);
** R14 SYNTAX **
x = h.Radius;
h.Radius = 50;
Refer to “Invoking Methods on an Object” in the External Interfaces
documentation.
Enumeration in COM Method Arguments
In addition to supporting enumeration for the properties of a COM object,
MATLAB now supports enumeration for parameters passed to methods of a
COM object. The only restriction is that the type library in use must report
the parameter as ENUM, and only as ENUM.
Refer to “Specifying Enumerated Parameters” in the External Interfaces
documentation.
Event Handling for COM Servers
In addition to handling events from ActiveX controls, MATLAB now handles
events fired by Automation servers as well. Use the same event handling
functions that you have been using for events from controls.
634
Function
Description
eventlisteners
Return a list of events attached to listeners
events
List all events, both registered and unregistered, a
control or server can generate
isevent
Determine if an item is an event of a COM object
registerevent
Register an event handler with a control or server
event
External Interfaces/API, MATLAB® Version 7 (R14)
Function
Description
unregisterallevents Unregister all events for a control or server
unregisterevent
Unregister an event handler with a control or server
event
Refer to “Responding to Events — an Overview” and in the External
Interfaces documentation.
Callbacks to COM Event Handlers Written as Subfunctions
Instead of having to maintain a separate .m file for every event handler
routine you write, you can consolidate some or all of these routines into a
single file using subfunctions.
Refer to “Writing Event Handlers as MATLAB File Subfunctions” in the
External Interfaces documentation.
Event Handlers Can Be Function Handles
In this release, you can now implement ActiveX event handlers as function
handles.
Optional Input Arguments to COM Methods
When calling a method that takes optional input arguments, you can skip any
optional argument by specifying an empty array ([]) in its place. The syntax
for invoke with the second argument (arg2) not specified is as follows:
invoke(handle, 'methodname', arg1, [], arg3);
See the section, “Optional Input Arguments” in the External Interfaces
documentation for more information.
Display of Interface Handles
MATLAB has changed the way it displays a COM interface in this release.
For example, the string used to represent an interface in MATLAB 6.5 was
[1x1 Interface.excel.application.Workbooks]
635
Version 7 (R14) MATLAB® Software
MATLAB 7.0 represents this same interface with the following string:
[1x1 Interface.Microsoft_Excel_9.0_Object_Library.Workbooks]
Compatibility Considerations. You may need to change any code that
depends on the previous behavior.
MATLAB Interface to Sun Java Programming
Language
Java Interface Adds Dynamic Java Class Path
MATLAB loads Java class definitions from files that are on the Java class
path. The Java class path now consists of two segments: the static path, and a
new segment called the dynamic path.
The static path is loaded from the file classpath.txt at the start of each
MATLAB session and cannot be changed without restarting MATLAB. This
was the only path available in previous versions of MATLAB. Thus, there was
no way to change the Java path without restarting MATLAB.
The dynamic Java class path can be loaded at any time during a MATLAB
session using the javaclasspath function. You can define the dynamic
path (using javaclasspath), modify the path (using javaaddpath and
javarmpath), and refresh the Java class definitions for all classes on the
dynamic path (using clear java) without restarting MATLAB. See the
function reference pages for more information on how to use these functions.
The javaclasspath function, when used with no arguments, displays both
the static and dynamic segments of the Java class path:
javaclasspath
STATIC JAVA PATH
D:\Sys0\Java\util.jar
D:\Sys0\Java\widgets.jar
D:\Sys0\Java\beans.jar
.
.
636
External Interfaces/API, MATLAB® Version 7 (R14)
DYNAMIC JAVA PATH
User4:\Work\Java\ClassFiles
User4:\Work\Java\mywidgets.jar
.
.
You can read more about this feature in the sections, “The Java Class Path”
and “Making Java Classes Available in MATLAB Workspace” in the External
Interfaces documentation.
Locating Java Native Method DLLs with File librarypath.txt
Previous versions of MATLAB required that you set a system environment
variable to enable Java to locate the shared libraries supporting any native
methods you need to use. This environment variable was PATH on Microsoft
Windows systems, and LD_LIBRARY_PATH on UNIX systems. This is no longer
necessary.
Now you can enter the names of those directories that contain native method
libraries in a new file called librarypath.txt using one line per directory.
The librarypath.txt file resides adjacent to the similar file classpath.txt
in the $matlab/toolbox/local directory.
General Features
New mx Functions
New functions mxIsInt64 and mxIsUint64 return true if an mxArray
represents its data as signed or unsigned 64-bit integers respectively.
Identifying Dependencies When MEX-Files Do Not Load
If MEX-files don’t load on a Windows system, the error message is not
informative. The Dependency Walker is a useful tool distributed with MSVC.
It is also freely available from http://www.dependencywalker.com.
637
Version 7 (R14) MATLAB® Software
Recompile MEX-Files on GLNX86 and Apple Macintosh
In Release 14, MATLAB uses C++ exception handling. MEX-files built prior
to R14 did not support C++ exceptions.
For example, write a C MEX-file that just calls mexErrMsgTxt. If you build
this with a release prior to Release 14 and run it, the program aborts
MATLAB. If you build this with Release 14 and run it, MATLAB will handle
the exception correctly.
Compatibility Considerations. On GLNX86 and Macintosh systems, all
MEX-files that can throw errors need to be recompiled for R14.
Shared Libraries Now In /bin/$ARCH
Shared libraries previously residing in directory $MATLAB/extern/lib/$ARCH
are now in $MATLAB/bin/$ARCH.
Compatibility Considerations. You may need to change any code that
depends on the previous behavior.
638
Compatibility Summary for
MATLAB Software
These tables summarize new features and changes that might cause
incompatibilities when you upgrade from an earlier version, or when you
use files on multiple versions. Details are provided with the description of
the new feature or change.
• “Version 7.11 (R2010b) MATLAB Software Compatibility Summary” on
page 641
• “Version 7.10 (R2010a) MATLAB Software Compatibility Summary” on
page 643
• “Version 7.9 (R2009b) MATLAB Software Compatibility Summary” on
page 645
• “Version 7.8 (R2009a) MATLAB Software Compatibility Summary” on
page 647
• “Version 7.7 (R2008b) MATLAB Software Compatibility Summary” on
page 649
• “Version 7.6 (R2008a) MATLAB Software Compatibility Summary” on
page 652
• “Version 7.5 (R2007b) MATLAB Software Compatibility Summary” on
page 655
• “Version 7.4 (R2007a) MATLAB Software Compatibility Summary” on
page 658
• “Version 7.3 (R2006b) MATLAB Software Compatibility Summary” on
page 661
639
Compatibility Summary for MATLAB® Software
• “Version 7.2 (R2006a) MATLAB Software Compatibility Summary” on
page 664
• “Version 7.1 (R14SP3) MATLAB Software Compatibility Summary” on
page 666
• “Version 7.04 (R14SP2) MATLAB Software Compatibility Summary” on
page 668
• “Version 7.01 (R14SP1) MATLAB Software Compatibility Summary” on
page 670
• “Version 7 (R14) MATLAB Software Compatibility Summary” on page 672
640
Version 7.11 (R2010b) MATLAB® Software Compatibility Summary
Version 7.11 (R2010b) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
• None
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Functions Being Removed” on page 15
• “optimset Errors for Optimization Toolbox Options” on page 16
• “atan Warning Being Removed” on page 16
Data Analysis
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Arrays of Time Series Objects Supported” on page 17
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Functions isa and islogical Now Consistent for Objects” on page 21
• “Comparing Object Arrays that Contain NaNs” on page 20
• “mmreader Renamed VideoReader” on page 22
• “Functions and Function Elements Being Removed” on page 25
• “MATLAB Did Not Pass struct to loadobj When Property Was
Deleted” on page 26
641
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Print –dmfile and printdmfile Issue Deprecation Warnings” on page
28
• “The saveas ’mmat’ option Issues a Deprecation Warning” on page 28
• “The movie Function is No Longer a Built-in Function” on page 28
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
“Functions and Function Elements Being Removed” on page 29
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Discontinued Compiler Support” on page 32
• “-largeArrayDims Option to MEX Will Become Default in Next
Release of MATLAB” on page 32
• “MEX Function -argcheck Option Removed” on page 33
• “MEX Function -inline Option Removed” on page 34
642
Version 7.10 (R2010a) MATLAB® Software Compatibility Summary
Version 7.10 (R2010a) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Preference for Java Heap Memory” on page 38
• “docopt Function Removed” on page 41
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Changes To qr” on page 47
• “Change in Indexing for Sparse Matrix Input” on page 47
• “Computational Geometry Functions Being Changed” on page 48
• “Computational Geometry Functions Being Removed” on page 48
• “lsqnonneg No Longer Uses Optional Starting Point Input” on page 48
• “Function erfcore Removed” on page 49
• “Integer Warning Messages Removed” on page 49
• “Function intwarning Being Removed” on page 49
• “atan Warning Being Removed” on page 50
• “nextpow2 Returns Output the Same Size As Input” on page 50
• “Math Libraries Not Available to Build MEX-Files with Compaq
Visual Fortran” on page 64
Data Analysis
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Operations on Timeseries Objects Sometimes Warn About the
isTimeFirst Property” on page 52
643
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Subscripting Into Function Return Values” on page 54
• “Functions and Function Elements Being Removed” on page 57
Graphics and 3-D
Visualization
None
Creating GUIs
None
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Discontinued Compiler Support” on page 63
• “-largeArrayDims Option to MEX Will Become Default in Next
Release of MATLAB” on page 65
• “Changes to Libraries on Linux with Debian Systems” on page 64
• “Math Libraries Not Available to Build MEX-Files with Compaq
Visual Fortran” on page 64
• “Cannot Create MEX-Files with DLL File Extension” on page 64
644
Version 7.9 (R2009b) MATLAB® Software Compatibility Summary
Version 7.9 (R2009b) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Changes to -nodisplay and -noFigureWindows Startup Options” on
page 71
• “Changes to Memory Manager Startup Options” on page 72
• “Ability to Customize Keyboard Shortcuts” on page 72
• “Improved Contents Listing” on page 74
• “Enhanced Current Folder (Directory) Browser” on page 79
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Computational Geometry Functions Being Changed” on page 86
• “Computational Geometry Functions Being Removed” on page 86
• “erfcore Being Removed” on page 87
Data Analysis
None
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Use of lasterror, lasterr, rethrow(errStruct) Not Recommended” on
page 92
• “Use of maxNumCompThreads No Longer Recommended” on page 93
• “Motion JPEG 2000 Files Supported by mmreader” on page 93
• “Minimum Sample Rate for audioplayer” on page 94
• “Ambiguity Error Now Reported” on page 96
645
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Enhanced Plot Selector Simplifies Data Display” on page 98
• “Certain Print Options and Devices Now Warn When Used” on page
101
• “The view Function No Longer Supports 4-by-4 Transformation
Matrices as Input” on page 102
Creating GUIs
None
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Discontinued Support for Intel Visual Fortran Version 9.1” on page
106
646
Version 7.8 (R2009a) MATLAB® Software Compatibility Summary
Version 7.8 (R2009a) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “New System Browser Preference Instead of docopt.m for MATLAB
on UNIX Platforms” on page 112
• “Help Browser No Longer Reopens at Startup” on page 113
• “Block Indenting Option No Longer Provided” on page 120
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Changes To conv2 and convn” on page 124
• “nextpow2 Changing to Element-By-Element Calculation in a Future
Release” on page 125
• “Function finite Being Removed” on page 125
• “64-bit Support in LAPACK and BLAS” on page 125
Data Analysis
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Data Brushing for Graphs and Linked Variables” on page 223 —
refers to features introduced in Version 7.6 (R2008a)
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• Setting the Number of Threads Removed from Preferences Panel
• Timer Objects Saved in New Format
• MATLAB Upgrades Support for HDF5 to Version 1.8.1
• Indirect Calls to Superclass Constructors Now Errors
647
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Certain Printer Formats and Drivers Now Warn When Used” on
page 179
Creating GUIs
None
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Discontinued Compiler Support” on page 137
• “Do Not Use mxFree to Destroy mxArrays” on page 137
• “Cannot Build MEX-Files Using MATLAB Version 5 API” on page 138
• “MEX-Files Calling BLAS or LAPACK Functions Must Be Updated
On 64-Bit Platforms” on page 138
• “Improved Robustness of Web Services Functions” on page 140
648
Version 7.7 (R2008b) MATLAB® Software Compatibility Summary
Version 7.7 (R2008b) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Macintosh Startup and Root Directory Enhancements and Changes”
on page 144
• “Changes to -nojvm Startup Option” on page 145
• “Changes to matlab Memory Manager Startup Options” on page 146
• “Current Directory Browser Enhanced, Including New Navigation
and Grouping Features” on page 154
• “Structure Results of dir for Nonexistent Files Now Include Empty
Matrices” on page 158
• “Semicolon (;) Path Separator Character Now Used on UNIX
Platforms” on page 160
• “Set Cursor to First Nonwhite Character on Line” on page 162
• “File and Directory Comparisons Tool: Highlight Changes” on page
163
• “Access Directory Reports” on page 164
• “Publish Setting: Cascading Style Sheet Is Now XSL File” on page 165
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Upgrade to Random Number Generator” on page 166
• “Functions and Properties Being Removed” on page 167
649
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Data Analysis
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Specialized Data Tips for the hist Function” on page 168
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “File Selection Restriction in Import Wizard” on page 173
• “Function Handle Array Warning Is Now An Error” on page 174
• “Two Types of issorted Warnings Are Now Errors” on page 175
• “Possible Conflict with New Keyword: SPMD” on page 175
• “isequal Is Now Called Explicitly for Contained Objects” on page 176
• “Indexed Assignment with Objects of the Form p(:) = o Now
Consistent with MATLAB Language” on page 177
• “fopen No Longer Supports VAXD, VAXG, and Cray Machine
Formats” on page 177
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Certain Printer Formats and Drivers Now Warn When Used” on
page 179
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Undocumented Functions Removed” on page 182
• “New Menu Options to Hide or Show GUIDE Toolbar and Status
Bar” on page 183
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Do Not Use DLL File Extensions for MEX-Files” on page 185
650
Version 7.7 (R2008b) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility Impact
• “MEX-Files Must Be Recompiled When -largeArrayDims Becomes
Default MEX Option” on page 186
• “Use mxDestroyArray to Release Memory for mxArray” on page 187
• “New Functions to Catch Errors in MEX-Files Replace
mexSetTrapFlag” on page 188
• “COM Objects Might Display Different Number of Supported Events”
on page 189
651
Compatibility Summary for MATLAB® Software
Version 7.6 (R2008a) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Windows Platforms — Startup Changes, Including Use of My
Documents/MATLAB or Documents/MATLAB Directory” on page 194
• “UNIX Platforms — Startup Changes” on page 194
• “Macintosh Platforms — Startup Changes” on page 195
• “Updated Version of JVM Software on Solaris Platform” on page 196
• “Changes to Abnormal Termination Process” on page 197
• “Command History Preference — Default Value Changed” on page
199
• “Array Editor Renamed to Variable Editor; Offers Enhanced Support
for Structures and Classes” on page 201
• “Search Path — Changes to User Portion” on page 202
• “New Context Menu Options in Current Directory Browser” on page
203
• “Stand-Alone Editor No Longer Provided” on page 204
• “Run/Continue Button Now Two Separate Buttons” on page 205
• “Evaluate Entire File Button Off Toolbar by Default” on page 205
• “mlint Function Uses Preference Settings when Java Software is
Available” on page 206
• “Nest Cells for Rapid Code Iteration; Includes Changes to Cell
Highlighting” on page 209
• “Publish Functions and Scripts Using Publish Configurations;
Includes Replacement of Publishing Preferences” on page 210
652
Version 7.6 (R2008a) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility Impact
• “Nest Cells for Finer Control” on page 212
• “Publish Button Moved” on page 218
• “stopOnError Option No Longer Available with publish Function”
on page 218
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Functions and Properties Being Removed” on page 222
Data Analysis
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Data Brushing for Graphs and Linked Variables” on page 223
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Multithreaded Computations Enabled” on page 229
• “Information on the State of Memory” on page 230
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• ““v6” Plotting Option Update — Affected Functions” on page 233
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
• “GUIDE No Longer Copies Callbacks When You Duplicate
Components” on page 339
• “Changes to How uicontrols Set Figure SelectionType” on page 237
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Interface to Generic DLLs Supported on 64-bit Platforms” on page
240
• “New Version of Perl on Windows Platforms” on page 242
653
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
• “Rebuild MEX-Files Created on Linux Platforms” on page 242
• “mex.bat File Removed from matlabroot\bin\$ARCH” on page 244
• “Discontinued Compiler Support” on page 241
• “Changes to Dynamic Data Exchange (DDE) Documentation” on page
246
654
Version 7.5 (R2007b) MATLAB® Software Compatibility Summary
Version 7.5 (R2007b) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Windows Platforms Startup Changes” on page 249
• “Changes to Look of Buttons in Desktop and Other Tools” on page 253
• “Demos and Help Browser Contents Now Include New Category for
Links and Targets” on page 254
• “Help on Selection Enhanced in Command Window and Editor” on
page 257
• “Run/Continue Button Changes” on page 260
• “Line Endings Removed in Files Provided with MATLAB Software
for Windows Platforms; Impacts Viewing in Notepad Application”
on page 263
• “Stand-Alone Editor Will Not Be Included in Next Version” on page
266
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “finite Function Deprecated” on page 269
• “Library for LAPACK and BLAS Symbols Separated” on page 270
• “Colon Operations on Characters Return Character Type Data” on
page 271
• “Matrix Generating Functions No Longer Accept Complex Inputs”
on page 271
Data Analysis
None
655
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “New Internal Format for P-code” on page 275
• “Change to Error Message from Anonymous Function” on page 277
• “New Message In Response to Ctrl+C” on page 278
• “hdfread Errors Instead of Warns on I/O Failures” on page 278
• “Results From tempname Are More Unique” on page 279
• “MATLAB Includes New Input Argument Validation Functions” on
page 279
• “Windows Current Working Directory Corrected” on page 279
• “Compressed AVI Video Files in Windows Vista and Windows XP
x64” on page 281
• “mmfileinfo Reads Files on MATLAB Path” on page 281
• “Removal of freeserial Function” on page 282
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Datatips Are Now Saved to FIG-Files” on page 283
• “The “v6” Option for Creating Plot Objects is Obsolete” on page 286
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Functions Being Removed” on page 290
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Support for 64-bit mxArrays” on page 292
• “Fortran MEX-Files Will Require mwSize and mwIndex” on page 293
• “Rebuild MEX-Files Created with MATLAB Versions Earlier Than
V7 (R14)” on page 294
656
Version 7.5 (R2007b) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility Impact
• “Discontinued Compiler Support” on page 295
• “Changes to Applications Built with Borland 5.5 or 5.6 C Compilers”
on page 296
• “Changes to Dynamic Data Exchange (DDE) Documentation” on page
297
• “Documentation for Obsolete Functions To Be Phased Out” on page
298
657
Compatibility Summary for MATLAB® Software
Version 7.4 (R2007a) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Double-Clicking Associated File Type in Explorer Now Opens File in
Existing Session of MATLAB Software” on page 301
• “Changes to Startup Directory (Folder) and Startup Options for
MATLAB Application on Windows” on page 302
• “JVM for Windows Updated” on page 305
• “Confirm Exit Preference to be Enabled by Default in Future Version”
on page 306
• “Tabs for Tools Replaced by Title Bars” on page 312
• “Macintosh Platforms—Some Key Bindings in Command Window
Changed” on page 315
• “Include Search Database for Your Own Help Files” on page 316
• “Video Tutorials Now Accessed Via Web Site” on page 316
• “Search Path Changes” on page 317
• “Stand-Alone Editor No Longer Opens By Default; To Be Removed in
a Future Version” on page 318
• “M-Lint Detection of Missing End-of-Line Semicolons Enhanced” on
page 320
• “Macintosh Platforms—Some Key Bindings in Editor/Debugger
Changed” on page 321
Math
See the Compatibility Considerations subheading for each of these
new features or changes:
• “rand Function Uses the Mersenne Twister Algorithm as Default”
on page 323
658
Version 7.4 (R2007a) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility Impact
• “mode of Empty Array Now Returns NaN” on page 325
• “Change to Syntax for Setting BLAS Library Version on Linux” on
page 325
Data Analysis
None
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Using whos -file on Objects with Overloaded size or class Methods”
on page 330
• “mat2str Returns Correct Output for Strings” on page 330
• “Warning Generated by try-catch” on page 331
• “Functions Not Callable If in Directory Under Class Directory” on
page 332
• “ispuma Function Deprecated” on page 334
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Movies No Longer Play During Loading” on page 335
• “Ghostscript Printing Software Upgraded” on page 336
• “Property Inspector Now Categorizes Graphic Object Properties” on
page 336
659
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
• “GUIDE No Longer Copies Callbacks When You Duplicate
Components” on page 339
• “GUIDE M-File-Defined handles Structure Fields No Longer Become
Permanent” on page 339
• “UNIX: File Dialog ’Location’ Property Is Obsolete” on page 340
• “Functions Becoming Obsolete” on page 340
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “MEX-Files in MATLAB for Apple Macintosh (Intel)” on page 342
• “MEX-Files in MATLAB for 64–bit Sun Solaris SPARC” on page 342
• “MEX-Files Built in MATLAB R11 or Earlier Must Be Rebuilt” on
page 343
• “Fortran Compatibility Considerations” on page 345
• “Discontinued Compiler Support” on page 345
660
Version 7.3 (R2006b) MATLAB® Software Compatibility Summary
Version 7.3 (R2006b) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
Desktop Tools
and Development
Environment
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Redirect Output on UNIX Now Sends Errors to Shell” on page
353
• “M-Lint Preferences Added and Now Appear on M-Lint Panel”
on page 354
• “New Look and Feel on Linux and Solaris Platforms” on page 356
• “Invalid info.xml File on Path Now Generates an Error” on page
356
• “Exact Phrase and Wildcard Searching Added; Change to Search
Database” on page 357
• “File Comparison Directory Report Removed; Replaced by File
Comparison Tool” on page 363
• “M-Lint Code Check Report Enhancements and Changes” on
page 363
• “mlint Message IDs Changed and %#ok Syntax Enhanced” on
page 363
Mathematics
See the Compatibility Considerations subheading for each of
these new features or changes:
• “max and min Now Use Magnitudes and Phase Angle for
Complex Input” on page 367
• “FFTW Upgraded to Version 3.1.1 in MATLAB” on page 369
• “Future Obsolete Functions” on page 370
• “Obsolete Functions” on page 370
661
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility
Impact
• “notebook Setup Arguments Removed” on page 365
• “max and min No Longer Return Warning Messages for Inputs
with Different Data Types” on page 371
Data Analysis
None
Programming
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Saving to MAT-Files Larger than 2 GB” on page 373
• “New Reserved MATLAB Keywords” on page 375
• “Enhancements to Display Generated by whos” on page 376
• “save Compression and Unicode Options Removed” on page 377
• “Warning Generated by try-catch” on page 378
• “Case-Sensitivity Warning Removed” on page 379
• “fprintf(0,...) Now Throws an Error” on page 379
• “Assigning Nonscalar Structure Array Fields to a Single
Variable” on page 380
• “Comma Separators Not Required in Function Declaration” on
page 381
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Version 6 Property Editor Has Been Removed” on page 382
• “New Desktop Printing GUI” on page 383
• “Customizing Zoom, Pan, and Rotate3D Data Explore Modes”
on page 384
662
Version 7.3 (R2006b) MATLAB® Software Compatibility Summary
Area
Creating GUIs
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Functions Are Now Obsolete” on page 386
• “Colored Buttons on Windows XP” on page 386
External Interfaces
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Sparse Arrays on 64-bit Systems” on page 389
• “New MAT-File Format Based on HDF5” on page 390
• “-V5 Option to MEX to Be Removed” on page 391
• “Location of mex.bat File Changed” on page 391
• “Changes to Compiler Support” on page 391
• “Actxcontrol Command Now Validates ProgID” on page 391
663
Compatibility Summary for MATLAB® Software
Version 7.2 (R2006a) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
Desktop Tools
and Development
Environment
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Installation Directory Structure on Windows Platforms” on page
395
• “Preferences Reorganized and New Keyboard Pane Added to
Support Command Window and Editor/Debugger” on page 396
• “Tab Completion — Tab Now Completes Function and Variable
Names” on page 399
• “Go Menu Added; Bookmark and Go To Items Moved from Edit
Menu to Go Menu” on page 400
• “Cell Mode On by Default — Shows Cell Toolbar and Possibly
Horizontal Lines and Yellow Highlighting; Cell Information Bar
and Button Added” on page 403
• “M-Lint and mlint Enhancements and Changes” on page 406
• “Visual Directory View Removed from Current Directory
Browser” on page 407
• “PVCS Source Control System Name Change” on page 408
Mathematics
None
Data Analysis
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Linux 64 Platform Fully Enabled for Time Series Tools” on page
411
664
Version 7.2 (R2006a) MATLAB® Software Compatibility Summary
Area
Programming
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Using avifile and movie2avi on Windows XP 64” on page 412
• “Regular Expressions” on page 413
• “MATLAB Warns on Invalid Input to str2func” on page 415
• “Changes to Character Encoding in File I/O” on page 415
Graphics and 3-D
Visualization
• “Pasting Cut or Copied Graphic Objects Can Create an Axes”
on page 419
Creating GUIs
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Treatment of & in Menu Label Is Changed” on page 421
External Interfaces
See the Compatibility Considerations subheading for each of
these new features or changes:
• “MEX-Files Built with gcc on Linux Must Be Rebuilt” on page 423
• “MEX-Files in MATLAB for Microsoft Windows x64” on page 424
• “Compaq Visual Fortran Engine and MAT Options File Renamed”
on page 425
• “Options Files Removed for Unsupported Compilers” on page 425
• “Obsolete Functions No Longer Documented” on page 426
665
Compatibility Summary for MATLAB® Software
Version 7.1 (R14SP3) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
Desktop Tools
and Development
Environment
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Startup Option, –nodesktop, on Windows Platforms No Longer
has Menu Bar and Toolbar; Use Function Equivalents Instead”
on page 435
• “Preferences Directory Added for R14SP3; Supplements R14
Directory” on page 437
• “info.xml File Automatic Validation; Shows Warnings for Invalid
Constructs” on page 439
• “Hyperlink Color Preference Moved” on page 440
• “Demos Run in Command Window as Scripts and Their Variables
Now Created in Base Workspace” on page 441
• “echodemo Function Added to Replace playshow function” on
page 442
• “Visual Directory View to be Removed” on page 443
• “HTML File Indenting Feature Added as the Default” on page 445
• “Notebook Setup Changes; Some Arguments Removed” on page
447
• “Versions of Microsoft Word Application Supported by Notebook;
Microsoft Word 97 No Longer Supported” on page 448
Mathematics
See the Compatibility Considerations subheading for each of
these new features or changes:
• “New Functions” on page 449
Data Analysis
666
None
Version 7.1 (R14SP3) MATLAB® Software Compatibility Summary
Area
Programming
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “New Functions” on page 455
• “Modified Functions” on page 456
• “isfield Function Supports Cell Arrays; Results Might Differ from
Previous Version” on page 457
• “Seconds Field Now Truncated; Results Might Differ” on page
460, “Built-in Functions No Longer Use .bi; Impacts Output of
which Function” on page 460, “New Warning About Potential
Naming Conflict” on page 461
Graphics and 3-D
Visualization
None
Creating GUIs
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Plans for Obsolete Functions” on page 463
External Interfaces
See the Compatibility Considerations subheading for each of
these new features or changes:
• “New File Extension for MEX-Files on Windows Systems” on
page 466
• “New Preferences Directory and MEX Options” on page 468
• “Compiler Support” on page 469
• “Import Libraries Moved” on page 469
667
Compatibility Summary for MATLAB® Software
Version 7.04 (R14SP2) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
Desktop Tools
and Development
Environment
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “JVM Software Updated” on page 474
• “Subfunction Help Syntax Changed” on page 475
• “Bug Fixes and Known Problems Now on Web; No Longer Found
Via Help Search” on page 475
• “Workspace Browser Preference Panel Removed” on page 476
• “Preference for Editor/Debugger Dialog Moved” on page 477
• “Register Project Feature Added; Add to Source Control Behavior
Changed” on page 478
• “Cell Publishing: File Extension Changes” on page 478
• “Notebook Support for Microsoft Word 97 Application to be
Discontinued” on page 479
Mathematics
See the Compatibility Considerations subheading for each of
these new features or changes:
• “max and min on Complex Integers Not Supported” on page 480
Programming
See the Compatibility Considerations subheading for each of
these new features or changes:
• “xlsread Imported Date Format Changes” on page 482
• “Nonscalar Arrays of Function Handles to Become Invalid” on
page 483
• “Assigning Nonstructure Variables As Structures Displays
Warning” on page 483
668
Version 7.04 (R14SP2) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility
Impact
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Cannot Dock Figures on Macintosh” on page 487
• “Plotting Tools Not Working on Macintosh” on page 487
• “Not All Macintosh System Fonts Are Available” on page 487
• “XDisplay Property Setable on Motif-Based Systems” on page 487
Creating GUIs
None
External Interfaces
None
669
Compatibility Summary for MATLAB® Software
Version 7.01 (R14SP1) MATLAB Software Compatibility
Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
Desktop Tools
and Development
Environment
New Features and Changes with Version Compatibility
Impact
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Construction of Classpath for Java Software Now Uses
librarypath” on page 493
• “Notebook Support for Word 97 to Be Discontinued” on page 498
Mathematics
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Different Results When Solving Singular Linear Systems on
Intel Systems; Inconsistent NaN Propagation” on page 501
• “funm Returns Status Information; New Output Might Result In
Error” on page 502
Programming
See the Compatibility Considerations subheading for each of
these new features or changes:
• “datevec Support of Empty String Argument” on page 504
• “ftell Returning Invalid Position in Rare Cases” on page 504
• “Logical OR Operator | in regexp Expressions Might Yield
Different Results from Previous Version” on page 506
• “Multiple Declarations of Persistent Variables No Longer
Supported” on page 507
670
Version 7.01 (R14SP1) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility
Impact
Graphics and 3-D
Visualization
See the Compatibility Considerations subheading for each of
these new features or changes:
• “Cannot Dock Figures on Macintosh Systems” on page 509
• “Plotting Tools Not Working on Macintosh Systems” on page 509
• “Not All Macintosh System Fonts Are Available” on page 509
• “Preview Java Figures on the Macintosh Platform” on page 509
Creating GUIs
See the Compatibility Considerations subheading for each of
these new features or changes:
• “FIG-File Format Change” on page 510
• “Panels, Button Groups, and ActiveX Components” on page 510
• “Windows XP Display of Push and Toggle Buttons” on page 511
External Interfaces
See the Compatibility Considerations subheading for this new
feature or change:
• “Specifying the Search Path for Sun Java Native Method DLLs”
on page 513
671
Compatibility Summary for MATLAB® Software
Version 7 (R14) MATLAB Software Compatibility Summary
For other versions, see the “ Compatibility Summary for MATLAB Software”.
Area
New Features and Changes with Version Compatibility Impact
Desktop Tools
and Development
Environment
See the Compatibility Considerations subheading for each of these
new features or changes:
• “terminal Function Removed” on page 523
• “license Function Results Modified Slightly” on page 524
• “Tab Completion Graphical Interface Added; Removed Preference to
Limit Completions” on page 524
• “Parentheses Matching Support Removed” on page 526
• “Documentation Now Automatically Installed; Not Accessible from
CD-ROMs and docroot Not Supported” on page 528
• “web Function Now Opens MATLAB Web Browser By Default” on
page 530
• “HTML Documentation Not Viewable with -nojvm Startup Option”
on page 530
• “Built-In Functions Now Treated Like Other M-Files on Search Path”
on page 532
• “savepath Function Added to Replace path2rc” on page 533
• “Create Block Comments Using %{ and %}” on page 538
• “dbstack Function Supports Nested Functions” on page 540
• “dbstatus Function Supports Conditional Breakpoints” on page 541
• “Rapid Code Iteration Using Cells” on page 541
• “Profiler for Measuring Performance” on page 545
• “Source Control Changes” on page 546
Mathematics
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Obsolete Functions” on page 551
672
Version 7 (R14) MATLAB® Software Compatibility Summary
Area
New Features and Changes with Version Compatibility Impact
• “Integer Data Type Functions Now Round Instead of Truncate” on
page 555
• “Changes to Behavior of Concatenation” on page 556
• “New Class Inputs for sum” on page 559
• “max and min Now Have Restrictions on Inputs of Different Data
Types” on page 562
• “Matrix, Trigonometric, and Other Math Functions No Longer Accept
Inputs of Type char” on page 566
• “New Names for Demos expm1, expm2, and expm3” on page 572
Programming
See the Compatibility Considerations subheading for each of these
new features or changes:
• “MATLAB Stores Character Data As Unicode; Making Release 14
MAT-files Readable in Earlier Versions” on page 576
• “MAT-Files Generated By Release 14 Beta2 Must Be Reformatted”
on page 577
• “Additional Bytes Reserved in MAT-File Header; Do Not Write To
Reserved Space” on page 578
• “Case-Sensitivity in Function and Directory Names; Can Affect Which
Function MATLAB Selects” on page 579
• “Differences Between Built-Ins and M-Functions Removed; Can Affect
Which Function MATLAB Selects” on page 584
• “Change to How evalin Evaluates Dispatch Context” on page 586
• “New Calling Syntax for Function Handles; Replace eval With New
Syntax” on page 591
• “Arrays of Function Handles” on page 592
• “Regular Expressions Accept String Vector; No Longer Support
Character Matrix Input” on page 598
• “Colon Operator on char Now Returns a char” on page 599
673
Compatibility Summary for MATLAB® Software
Area
New Features and Changes with Version Compatibility Impact
• “Reading Date Values with xlsread; Conversion No Longer Necessary”
on page 600
• “Changes to Error Message Format” on page 606
3-D Graphics and
Visualization
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Plotting Tools Not Working on Macintosh Platform” on page 620
• “Using -nojvm Option Prevents Plotting Tools Use” on page 620
• “MATLAB 6 Version Property Editor” on page 621
• “Cannot Dock Figures on Macintosh Platform” on page 621
• “Not All Macintosh System Fonts Are Available” on page 621
Creating GUIs
See the Compatibility Considerations subheading for each of these
new features or changes:
• “New Container Components” on page 622
• “New Syntax for uigetfile and uiputfile” on page 626
• “Frames Not Available in GUIDE Layout Editor” on page 627
External Interfaces
See the Compatibility Considerations subheading for each of these
new features or changes:
• “Saving Character Data with Unicode Encoding” on page 628
• “Display of Interface Handles” on page 635
• “Recompile MEX-Files on GLNX86 and Apple Macintosh” on page 638
• “Shared Libraries Now In /bin/$ARCH” on page 638
674
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement