R2012b

New Features, Bug Fixes, Compatibility Considerations

Desktop

Toolstrip that replaces menus and toolbars in MATLAB Desktop

New MATLAB Desktop (5 min, 3 sec)

  • The Toolstrip contains components that were previously available in menus, toolbars, and the Start button. Tabs such as Home, Plots, Apps, Editor, and Variable, group functionality to support common tasks.

  • The Apps tab contains a gallery of apps from the MATLAB® family of products. You also can install your own apps, which appear in the apps gallery.

  • The quick access toolbar contains frequently used options such as cut, copy, paste. The quick access toolbar is customizable; you can add items from tabs or from command shortcuts you create. You can also change the position of the toolbar on the Desktop.

  • The current folder toolbar enables you to control the current working directory. The location and the controls available are customizable.

  • The Search Documentation box enables you to search the documentation for functions and other topics of interest.

Apps gallery that presents apps from the MATLAB product family

The MATLAB desktop contains a gallery of apps from the MATLAB family of products. You can also install your own apps, which appear in the apps gallery.

  • To access the apps gallery, on the desktop Toolstrip, click the Apps tab, and then, on the far right of the Apps section, click the arrow .

  • To find and install apps written by others, click the Apps tab, and in the File section, click Get More Apps.

Single-file application packaging as a MATLAB App Installer file for inclusion in the apps gallery

Packaging and Installing MATLAB Apps (2 min, 58 sec)

You can package your GUI as a single installer file that contains all of the code and data needed to run your app, as well as a description of your app. Share your app with others by uploading the installer file to File Exchange or sending it as an email attachment. When your app installs, it appears alongside apps from the MathWorks® family of products in the apps gallery. For more information, see Package Apps.

Redesigned Help with improved browsing, searching, and filtering

Redesigned Help (5 min, 43 sec)

Searching and navigation

The R2012b release includes a redesigned documentation system with streamlined product pages, detailed search suggestions, and enhanced filtering of search results.

Each product's documentation is now organized by categories of functionality, such as Graphics or Simulation, rather than by information type, such as Function Reference or User's Guide. Categories include links to related reference pages, examples, and conceptual topics, allowing you to browse from one to another.

Most features of the previous Help browser are available in the new browser, although some functionality has a different appearance or location. For example:

  • The table of contents for each product is collapsed by default to maximize the space available for reading topics. Expand the table of contents from any page in the Help browser by clicking the Table of Contents button, .

  • Links to alphabetical lists of reference pages, such as functions or blocks, appear at the bottom of each product page.

  • Tasks previously performed using menu items in the Help browser, such as setting preferences or viewing page locations, are now accessible via context (right-click) menus, keyboard shortcuts, or toolbar buttons.

    Note

    On Macintosh systems, there are no context menu items for Evaluate Selection or Get Page Address. You can copy selected code to the Command Window for evaluation by pressing Shift+F7. However, in this release, there is no way to identify the page address.

  • Demos are now labeled Examples, and are accessible from the top of each product page. When you select video examples, they open in your system Web browser.

  • All release notes for a product appear on the same page, allowing you to track changes across several releases from a single location.

The new Help browser is used exclusively for the documentation of MathWorks products. As a result:

  • The web command opens all pages that are not part of the documentation in the MATLAB Web browser, even when you specify the -helpbrowser option. Because this is the default behavior of the web command, the -helpbrowser option has been removed from the documentation.

  • When the doc command does not find a documentation page, but does find associated help text, it displays the text in the MATLAB Web browser rather than the Help browser.

  • Custom documentation and documentation for downloadable or third-party products displays in a separate browser. To access this browser, open the Help browser and navigate to the documentation home page. Then, at the bottom of the page, click Supplemental Software.

Font size in Help browser and Web browser

The Help browser and Web browser now allow you to zoom in and out to adjust the font size by pressing Ctrl and + or .

In-product access to online documentation

From within the product, you can access either the installed documentation or the documentation on the Web. By default, your Help preference is set to view the installed documentation. If you change the preference to view the Web documentation, then you can choose to view documentation for products that you do not have installed.

Searches using the doc command

In previous releases, if you passed a term to the doc command that did not correspond to the name of a MathWorks reference page or to a file with help text, the doc command issued an error. Now, the doc command searches the documentation for the term, and displays the search results in the Help browser.

Improved rendering in Help browser and Web browser

The new Help browser uses a different rendering engine than the previous Help browser. This engine provides improved legibility, particularly on Microsoft® Windows® 64-bit systems.

The MATLAB Web browser also uses this rendering engine on all platforms. In previous releases, the Web browser used this engine only on Microsoft Windows systems.

This rendering engine is not fully supported on Red Hat® 5 operating systems, so not all Help features are available on those systems. For example:

  • Search suggestions are available from the search bar in the desktop, but not within the Help browser.

  • Some components of the search results page are not available, such as filtering.

  • The Help browser can display installed product documentation, but not the documentation on the Web.

Compatibility Considerations

  • The Help system now requires that custom documentation files reside outside the matlabroot folder (but on the MATLAB search path). To view any installed custom documentation, open the Help browser and navigate to the documentation home page. Then, at the bottom of the page, click Supplemental Software.

  • The demo command no longer supports categories of MATLAB or Simulink® examples.

  • For some products (primarily third-party toolboxes), the demo command requires different input values to specify the product type or name. The demo command now identifies each product using its info.xml file rather than its demos.xml file. For most MathWorks products, the product information is the same in both files.

  • In a future release, MathWorks will remove support for demos.m files, an old way to include demos in the Help browser. For the recommended method, see Display Custom Examples.

Viewing of multiple documentation pages simultaneously with tabbed browsing

The Help browser now allows you to open multiple tabs so that you can view more than one documentation topic at a time. Open a new tab by clicking the New Tab button, , or by right-clicking a link.

Suggested corrections for mistyped functions and variables in the Command Window

Command Window Suggestions for Mistyped Functions and Variables (2 min, 1 sec)

MATLAB can show suggestions in the Command Window for misspelled functions and variable names. If you enter an undefined function or variable name, MATLAB displays:

Did you mean:

followed by a suggested command at the command line. You can press Enter to execute that command, or Esc to delete the suggestion.

Full-screen view mode on Mac operating systems

MATLAB can operate in full-screen mode on Mac OS X 10.7 Lion.

Changes to -nojvm startup option on Mac

When you start MATLAB on a Mac with the -nojvm startup option, Handle Graphics® functionality is no longer supported. MATLAB will produce an error. Previous to this release, calls to Handle Graphics functionality would work but generate a warning. (For more information about the -nojvm option, see the matlab (UNIX) reference page.)

Tabs in MATLAB Web browser

The MATLAB Web browser now allows you to open multiple tabs so that you can view multiple reports or Web sites simultaneously. Open a new tab by clicking the New Tab button, .

Direct access to run configurations from the Run button

Now you can type commands directly using the Run options on the Editor tab.

In previous versions, you accessed run configurations by clicking the Run button down arrow and selecting Edit Run Configurations for filename.

Compatibility Considerations

MATLAB R2012b does not automatically copy run configurations from versions prior to R2012b. To transfer run configurations from a release prior to the MATLAB R2012b installation:

  1. Open prefdir\run_configurations.m. To identify your preference directory, type prefdir in the Command Window.

    Run configuration entries appear similar to this example:

    %% @name foo
    %  @associatedFile C:\Documents\MATLAB\work\foo.m
    %  @mostRecentlyActioned true
    %  @uniqueId 695644b0:1355f0bb372:-7fb0
    
    % Modify expression to add input arguments.
    % Example:
    %   a = [1 2 3; 4 5 6]; 
    %   foo(a);
    foo(1,2)

  2. Copy the MATLAB command in the run configuration. In the example configuration, the command is foo(1,2).

  3. Open the MATLAB file associated with the run configuration that you want to keep. In the example configuration, the file is C:\Documents\MATLAB\work\foo.m.

  4. Click and then the field containing type code to run.

  5. Paste the MATLAB command.

If the MATLAB expression spans multiple lines, create a script, and copy and paste the code into the script. You can then run the script directly using .

Multiple vector creation from single selection in Variables editor

The Variables editor now allows you to create one or more new row or column vectors from a single selection within an existing variable. The names of the new variables are based on the name of the existing variable. Previously, the Variables editor could only create a new array from a single selection, and new variables were called unnamed, unnamed1, …, unnamedN.

Language and Programming

Abstract attribute for declaring MATLAB classes as abstract

Declare MATLAB classes as abstract by setting the class Abstract attribute. See Defining Abstract Classes for more information.

Diagnostic message improvements when attempting to create an instance of an abstract class

Attempting to instantiate an abstract class returns a list of abstract members and their defining classes in the error diagnostic message. The meta.abstractDetails function finds abstract members defined or inherited by abstract classes.

Handle and dynamicprops do not support the empty static method

For R2012b, the handle and dynamicprops classes no longer support the empty static method. This change makes these classes consistent with all MATLAB abstract classes.

Compatibility Considerations

MATLAB software issues an error for calls to the empty static method from the handle and dynamicprops classes:

% Will return errors
handle.empty
dynamicprops.empty

See Creating Empty Arrays for information on using empty.

Switch uses eq to compare enumerations

Switch statements use the enumeration eq method to compare the switch expression with the case expression (see switch). In previous releases, switch used a special comparison that required the result of both expressions to belong to the same enumeration class. The result of the comparison is determined by the result of:

switch_expression == case_expression

The new behavior is consistent with that of other conditional statements, such as if statements.

Compatibility Considerations

Code that uses enumerations in switch statements can behave differently in release R2012b than in a previous release.

Cannot specify property attributes multiple times

Classes can define a property attribute only once in a properties block. Defining the same attribute more than once in a properties block causes an error when the class is instantiated.

Compatibility Considerations

Classes that define the same property attribute multiple times in a properties block will error when attempting to instantiate the class. Previously, MATLAB evaluated property attribute specifications in right to left order.

Discontinued compiler support for building MEX-files

MATLAB no longer supports the following compilers on Linux® 32-bit platforms:

  • GNU® gcc Version 4.4.x

  • GNU gfortran 4.3.x

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 Supported and Compatible Compilers.

Jagged array support for .NET

MATLAB does not support:

Java exceptions accessible to MATLAB code

If you call a Java® method from MATLAB, and that code throws an exception, use the matlab.exception.JavaException class to handle the exception in MATLAB.

Ability to add jar files to static Java class path

To use third-party Java libraries in MATLAB, you can control the Java class path and native library path by creating javaclasspath.txt and javalibrarypath.txt files. For more information, see The Static Path and Locating Native Method Libraries.

Preservation of string functions for backwards compatibility

The R2010a Release Notes originally stated that the isstr, setstr, str2mat, strread, strvcat, and textread functions would be removed in a future release. As of R2012b, there are no plans to remove these functions. However, use of these functions is not recommended.

FunctionRecommended Modification
isstrReplace all existing instances of isstr with ischar.
setstrReplace all existing instances of setstr with char.
str2matReplace all existing instances of str2mat with char.
strreadReplace 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.
strvcatReplace all existing instances of strvcat with char. Unlike strvcat, the char function does not ignore empty strings.
textreadReplace all existing instances of textread with textscan, similar to strread. Open and close files with fopen and fclose.

Conversion of Error and Warning Message Identifiers

For R2012b, error and warning message identifiers have changed in MATLAB.

Compatibility Considerations

If you have scripts or functions that use message identifiers that changed, you must update the code to use the new identifiers. Typically, message identifiers are used to turn off specific warning messages, or in code that uses a try/catch statement and performs an action based on a specific error identifier.

For example, the MATLAB:uitable:InvalidParent identifier has changed to MATLAB:uitable:ParentMustBeFigureOrUIContainer. If your code checks for MATLAB:uitable:InvalidParent, you must update it to check for MATLAB:uitable:ParentMustBeFigureOrUIContainer instead. For a mapping of the new identifiers to the original identifiers, see Technical Support solution 1-ERAFNC.

Mathematics

Performance improvements and multithreading for airy, psi, and Bessel functions

The following functions show improved performance: besselh, besseli, besselj, besselk, bessely, airy, and psi.

ddensd function that solves delay differential equations of neutral type with state-dependent delays

The ddensd function solves neutral delay differential equations that involve both the solution and its first derivative evaluated in the past:

y '(t) = f(t, y(t), y(dy1),...,y(dyj), y '(dyp1),...,y '(dypk))

The delays, dy and dyp, can be time-dependent, state-dependent, or both.

Signed integer support for bit-wise operations

The bitand, bitor, bitxor, bitcmp, bitshift, bitget, and bitset, functions now support signed integers.

An additional input argument, assumedtype, is an optional string argument you can pass to any of these functions. Use assumedtype to indicate the assumed integer class for input values of type double. For example, bitor(14,240,'uint8') treats 14 and 240 as unsigned 8-bit integers even though they are passed as integers of type double.

assumedtype can be one of the following strings: 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', or 'uint64'. The default value of assumedtype is 'uint64' for input values of type double. If the input values belong to an integer class, assumedtype defaults to the class of the input values.

atan2d function that calculates four-quadrant inverse tangent with result in degrees

atan2d calculates the four-quadrant inverse tangent and returns angles in degrees that lie in the closed interval [–180,180].

Complex number support for trigonometry degree functions

The sind, cosd, tand, asind, acosd, atand, cscd, cotd, secd, acscd, asecd, and acotd functions now support complex values. For example, sind(10+i) returns 0.1737 + 0.0172i. Likewise, asind(2) now returns the complex angle 90.0000 -75.4561i.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations
bitshift(A,k,N)Still Runsbitshift(A,k,assumedtype)Replace all instances of bitshift(A,k,N) with bitshift(A,k,assumedtype).
bitcmp(A,N)Still Runsbitcmp(A,assumedtype)Replace all instances of bitcmp(A,N) with bitcmp(A,assumedtype).
bitshift(A,k) where A is of typedouble.Still runsNot Applicablebitshift now interprets double input as uint64 instead of 53-bit signed integer by default. For example, bitshift(1,54) now returns 1.8014e+16 instead of 0.
mimofrWarnsNot ApplicableRemove all instances of mimofr from your existing code.
Second output argument for besselh, besseli, besselj, besselk, bessely, and airy. For example, [J,ierr] = besselj(nu,Z).ErrorsSyntax that returns only the solution vector. For example, J = besselj(nu,Z).Replace all instances that return two output arguments with the syntax that returns only the solution vector.
Passing mixed-orientation input vectors to besselh, besseli, besselj, besselk, and bessely. For example, passing a row vector followed by a column vector:
J= besselj(rowNu, colZ)
or passing a column vector followed by a row vector:
J= besselj(colNu, rowZ)
Errors

First construct the inputs with ndgrid or meshgrid. Alternatively, you can pass a function handle and the mixed-orientation vectors to bsxfun.

Modify all instances that pass mixed-orientation vectors. You can modify your code in one of two ways:
  • Call meshgrid or ndgrid to construct the full grid first.

    [nu,Z]= meshgrid(rowNu, ColZ);
    J= besselj(nu, Z);

  • Pass a function handle and the mixed-orientation vectors to bsxfun. For example, if your existing code passes a row vector followed by a column vector, make the following change:

    J= bsxfun(@besselj, rowNu, colZ);or, if your code passes a column vector followed by a row vector, make the following change:

    J= bsxfun(@besselj, colNu', rowZ.');

Y = psi(k0:k1,X)ErrorsY = psi(k,X) where k is a scalar specifying the kth derivative of ψ at the elements of X.Replace all instances of Y = psi(k0:k1,X) with Y = psi(k,X), where k is a scalar. To modify your code, loop through the values k0:k1. For example:
for k=k0:k1
	Y(:,k) = psi(k,X);
end
In the future, size(Y) will be size(X). Modify any code that depends on size(Y).
Passing empty and nonscalar input to besselh, besseli, besselj, besselk, bessely, and airy. For example,
J = besselj([],(1:3))
or
J = besselj((1:3),[])
ErrorsJ = besselj(nu,[]) or J = besselj([],Z) where nu and Z are scalars.Modify all instances that pass combinations of empty arrays with nonscalar input. The inputs must be the same size or one must be a scalar.

Data Import and Export

Data import from delimited and fixed-width text files using Import Tool

The Import Tool now allows you to preview data in delimited and fixed-width text files and select ranges of data to import. You also can define rules for handling nonnumeric values, and import data as column vectors, a matrix, a cell array, or a dataset array, in a single step. This tool opens instead of the Import Wizard for text files.

For more information, watch this video.

Single-step import of numbers, text, and dates as column vectors from a spreadsheet with Import Tool

The Import Tool now allows you to import columns of numeric data, text, and dates from spreadsheets as multiple column vectors in one step. Previously, this functionality was available for numeric data only.

audioread and audioinfo functions for reading MP3, MPEG-4 AAC, WAVE, and other audio files

The audioread and audioinfo functions read and provide information about MP3, MPEG-4 AAC, WAVE, OGG, and FLAC files on all platforms.

audioread is a drop-in replacement for the most common forms of wavread and auread. In most cases where you use wavread or auread, you can rename instances of these functions to audioread.

audiowrite function for writing MPEG-4 AAC, WAVE, and other audio files

The audiowrite function writes data to WAVE, OGG, and FLAC files on all platforms. audiowrite writes data to MPEG-4 AAC files on Windows and Mac platforms.

audiowrite is a drop-in replacement for the most common forms of wavwrite. In most cases where you use wavwrite, you can rename instances of this function to audiowrite.

Reading and writing of BigTIFF image files larger than 4 GB

MATLAB now supports BigTIFF image files larger than 4 GB. You can use imread or the Tiff object.

Reading of XLSM, XLTX, and XLTM files on all platforms with xlsread function

The xlsread function now reads data from XLSM, XLTX, and XLTM files on all platforms. Previously, this functionality was available only on Microsoft Windows systems with Excel® software.

xlsread function now supporting named ranges on all platforms

The xlsread function now supports named ranges as inputs, on all platforms. For example, you can call

num = xlsread(filename,sheet,xlRange);

where xlRange refers to a named range of data in your Excel workbook. Previously, this functionality was available only on Microsoft Windows systems with Excel software.

Multiple delimiter support in textscan function

The textscan function recognizes multiple different delimiters within a single file. textscan also can treat multiple repeated delimiter characters as a single delimiter.

Timeout, user agent, and character encoding inputs for urlread and urlwrite functions

The urlread and urlwrite functions accept the following optional attribute-value pair arguments.

AttributeValue
TimeoutTimeout duration
UserAgentClient user agent identification
CharsetCharacter encoding, determined from the headers of the file

For example, to download Web content from a the MATLAB Central File Exchange while specifying a timeout duration of 5 seconds, type

urlread('http://www.mathworks.com/matlabcentral/fileexchange','Timeout',5);

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
avifileWarnsVideoWriterReplace all instances of avifile with VideoWriter.
wavplayWarns audioplayer and playReplace all existing instances of wavplay with audioplayer and play.
wavrecordWarnsaudiorecorder and recordReplace all existing instances of wavrecord with audiorecorder and record.
wk1finfoErrors Remove all instances of wk1finfo. Get information about Excel spreadsheets with xlsfinfo.
wk1readErrors Remove all instances of wk1read. Read Excel spreadsheets with xlsread.
wk1writeErrors Remove all instances of wk1write. Write to Excel spreadsheets with xlswrite.