MATLAB Release Notes

R2014b

New Features, Bug Fixes, Compatibility Considerations

Desktop

Git and Subversion source control system integration through Current Folder browser, including syncing from Web-hosted repositories such as those on GitHub

The MATLAB® Current Folder browser includes a column with source code status for files that are contained in Git™ and Subversion® repositories. You can retrieve repositories and access source control functionality through the context menus. For more information, see Source Control Integration.

Packaging of custom MATLAB toolboxes into a single, installable file

You can package your toolbox as a single installer file (.mltbx) that contains all of the code, data, apps, documentation, and examples necessary to use your toolbox. Share your toolbox with others by uploading the installer file to the File Exchange or by sending it as an email attachment. For more information, see Create and Share Toolboxes.

Dialog box for managing custom MATLAB toolboxes

You can use the Manage Custom Toolboxes dialog box to view details about the installed custom toolboxes or to uninstall the toolboxes. To access the Manage Custom Toolboxes dialog box, go to the Resources section of the Home tab and select Manage Custom Toolboxes from the Add-Ons menu.

Preference for controlling the initial working folder, with the option to start in the folder from your previous MATLAB session

For information about setting this option, see General Preferences.

Compatibility Considerations

On Windows® platforms, do not use the Start in field in the MATLAB Properties window. Instead, use the Specify the full path to a folder option in the Preferences panel.

Copying and pasting variables in the Workspace browser

You now can copy and paste the contents of workspace variables in the Workspace browser. Just right-click, select Copy, and then Paste. Alternatively, you can use the Ctrl+C and Ctrl+V keyboard shortcuts. Previously, this action opened the Import Tool for importing the variable name as a string.

Self-paced eLearning available from within MATLAB

MATLAB Academy is the entry point to self-paced eLearning from within MATLAB. Through MATLAB Academy, you can participate in interactive training courses to get you started with MATLAB.

To access MATLAB Academy from within MATLAB, go to the Resources section of the Home tab and select MATLAB Academy from the Help menu. Alternatively, you can access MATLAB Academy from the Getting Started with MATLAB documentation or online at https://matlabacademy.mathworks.com/R2014b. You must have a MathWorks® account associated with an active license.

New startup switch to opt out of automatically switching to software OpenGL

If MATLAB detects it is running with a graphics driver that has known issues, it automatically switches to software OpenGL®. You can opt out of this behavior by calling MATLAB with the -nosoftwareopengl startup option. See matlab (Windows) or matlab (UNIX).

To re-enable automatic switching to software OpenGL, call MATLAB with the -softwareopengl startup option.

These startup options are not available on Mac platforms.

Color settings preferences in Comparison Tool

You can change and save your color preferences for the MATLAB Comparison Tool. Apply your color preferences when comparing text files, MAT-files, variables, model files, zip files, or folders. For details, see Change Color Preferences.

Automatic file saving when you click away from the Editor

If you are editing a file in the MATLAB Editor that you have saved at least once, new changes are automatically saved if you click away from the Editor.

This setting is on by default, and is accessible through MATLAB Editor/Debugger Preferences. On the Home tab, in the Environment section, click Preferences, and select Editor/Debugger. Disable the setting under Automatic file changes by clearing the Save changes upon clicking away from a file check box.

Language and Programming

datetime, duration, and calendarDuration arrays for efficient computation, comparison, and formatted display of dates and times

datetime, duration and calendarDuration are new data types for representing dates and times. You can manipulate arrays of these types in the same way that you work with numeric arrays. For example, you can add, subtract, sort, compare, concatenate, and plot date and time values.

The new data types support the following features:

  • Functions for both calendar computations and fixed-length time computations on absolute dates and times, and elapsed times

  • TimeZone property for setting and converting datetime time zone, accounting for daylight saving time

  • Customizable default display format for dates

  • Nanosecond precision for absolute times

  • Import of data as datetime arrays using the Import Tool and the readtable and textscan functions

For more information, see Dates and Time.

Compatibility Considerations

When importing data from spreadsheets or text files using the Import Tool, there is no longer an option to convert dates to numeric serial date numbers. Instead, import the data into a table or as column vectors, and specify the datetime data type for each column of dates.

Suggested corrections for syntax errors in the Command Window

MATLAB suggests corrections for function names mistyped in the Command Window. This functionality now includes suggestions for:

  • Missing closing parentheses or brackets such as ), ], and } in function calls and arrays

  • Common assignment operators such as ++, +=, and -=, and mathematical operator idioms such as 2(x+1)

  • Python® argument syntax and dictionary syntax

Suggested MathWorks products for undefined functions

MATLAB suggests which MathWorks product is required for an undefined function. This information includes links to documentation and product information. For example, if you do not have the Aerospace Toolbox,

angle2quat
To use 'angle2quat', you might need:
  angle2quat - Aerospace Toolbox

Prior to R2014b, MATLAB displayed an ‘Undefined function' error.

Create multiple search indexes for help files you create

You can create multiple search indexes for help files you create: one for when you use MATLAB R2014a or earlier, and another for when you use MATLAB 2014b.  MATLAB automatically uses the appropriate index for searching your documentation database. For details, see builddocsearchdb

py package for using Python functions and objects in MATLAB, and an engine interface for calling MATLAB from Python

For information about calling Python functions in MATLAB, see Call Python Libraries.

For information about calling MATLAB from Python, see MATLAB Engine for Python.

matlab.wsdl.createWSDLClient function for accessing SOAP-based Web services

You must download supported versions of the Oracle® Java® JDK™ and the Apache™ CXF programs. For information, see Set Up WSDL Tools.

RPC-encoded WSDL documents are not supported. For these documents, use createClassFromWsdl.

The following WSDL documents are not supported:

  • Some documents with messages containing multiple parts.

  • Some documents with schemas containing anonymous complex types.

  • Documents that the Apache CXF program cannot compile into complete code.

Compatibility Considerations

createClassFromWsdl, createSoapMessage, callSoapService, and parseSoapResponse will be removed in a future release. Use matlab.wsdl.createWSDLClient instead.

Graphics objects in MEX-files use object handles instead of numeric handles

Graphics objects use object handles of various types instead of the numeric handles used in previous releases.

Compatibility Considerations

Do not write MEX-file code using the mexGet or mexSet functions, which assume a handle to a graphics object is a numeric value. Use the mxGetProperty or mxSetProperty functions instead. For more information, see Upgrade MEX-Files to Use Graphics Objects.

Workflow improvements when editing classdef files, including immediate impact on existing and new workspace variables

This feature eliminates the need to clear existing objects or call clear classes when changing the definition of the object's class. This feature also provides the ability to create objects based on the new definition without generating a warning that the class has changed. MATLAB updates existing objects according to the new class definition. For more information, see Automatic Updates for Modified Classes.

MATLAB errors attempting to define listener for nonobservable property

In previous releases, you could define a listener for a nonobservable property. MATLAB silently ignored the listener and did not call the listener callback. With release MATLAB 2014b, attempting to create a listener using event.proplistener or addlistener for a nonobservable property causes an error.

Compatibility Considerations

If your code used meta-data or the properties function to get a list of all properties defined by a class, and then assigns listeners to all properties, you should change your code. Rewrite the code to determine if a given property is observable before assigning the listener. For example, this code determines which properties of MyClass are SetObservable or GetObservable.

mc = ?MyClass;
p = findobj(mc.PropertyList,'SetObservable',1,'-or','GetObservable',1)

p contains the meta.property objects for the properties of MyClass that are SetObservable or GetObservable.

Script-based tests in unit testing framework

The MATLAB unit testing framework now provides script-based writing, execution, and verification of tests as an alternative to writing function-based or class-based tests. For more information, see Write Script-Based Unit Tests.

Plugin to report code coverage in unit testing framework

The matlab.unittest testing framework provides a plugin that produces a code coverage report for MATLAB source code. For more information, see the matlab.unittest.plugins.CodeCoveragePlugin documentation.

Control logging and verbosity in unit testing framework

Test authors can control the verbosity of logged messages in their tests. To register messages at different verbosity levels, call the log method with a TestCase or Fixture. To control the verbosity of the output, use a plugin such as LoggingPlugin or TestRunProgressPlugin, or a test runner constructed with the TestRunner.withTextOutput method.

Constraint for scalar values in unit testing framework

You can use the matlab.unittest.constraints.IsScalar constraint class to test that an actual value is a scalar.

Test suites from packaged functions and scripts

The unit testing framework recognizes function-based and script-based tests that are contained within a user-defined package. For more information, see TestSuite.fromPackage and runtests.

Failure of unit tests using a relative tolerance when the expected value is infinite and the actual value is finite

If a test qualification applies a relative tolerance and the expected value is infinite, the test fails if the actual value is finite. For example,

tc = matlab.unittest.TestCase.forInteractiveUse;
tc.verifyEqual(1,Inf,'RelTol',1e-12);
Interactive verification failed.

---------------------
Framework Diagnostic:
---------------------
verifyEqual failed.
--> The values are not equal using "isequaln".
--> The error was not within relative tolerance.
--> Failure table:
            Index    Actual    Expected    Error    RelativeError    RelativeTolerance
            _____    ______    ________    _____    _____________    _________________
        
            1        1         Inf         -Inf     NaN              1e-12            

Actual double:
         1
Expected double:
       Inf

Compatibility Considerations

Change any instances of test qualifications in which you compare an infinite expected value to a finite actual value using a relative tolerance, and expect the test to pass.

rmdir treatment of asterisk as literal character on Linux and Mac

On Linux® and Mac platforms, the rmdir function treats the asterisk character (*) as a literal character if a file or folder named * exists in the current folder. If such a file or folder does not exist, then rmdir treats the asterisk as a wildcard character. On Windows, rmdir always treats * as a wildcard character.

Previously, rmdir treated * as a wildcard character on all platforms.

Compatibility Considerations

Change code that expects to remove all files and folders using a wildcard character, on Linux and Mac.

Functionality being removed or changed

FunctionalityResultUse This InsteadCompatibility Considerations

createClassFromWsdl

Warns

matlab.wsdl.createWSDLClient

Replace all instances of createClassFromWsdl with matlab.wsdl.createWSDLClient.

RPC-encoded WSDL documents are not supported.

createSoapMessage
callSoapService
parseSoapResponse

Still runs

matlab.wsdl.createWSDLClient

Replace all instances of createClassFromWsdl with matlab.wsdl.createWSDLClient.

matlab.unittest.
TestCase
constructor

Still runs

matlab.unittest.TestCase.forInteractiveUse

Replace all instances of creating a TestCase object using the default constructor.

Use the TestCase.forInteractiveUse static method for interactive, command line use.

When tests are run in the unit testing framework, instances are created by the test runner.

matlab.unittest.plugins.
TestSuiteProgressPlugin

Still runs

matlab.unittest.plugins.TestRunProgressPlugin

Replace all instances of TestSuiteProgressPlugin.

To construct a plugin with the same level of detail, use TestRunProgressPlugin.withVerbosity(2).

mexGet
mexSet

Errors

mxGetProperty
mxSetProperty

For MEX-files, replace all instances of mexGet and mexSet with mxGetProperty or mxSetProperty in the C/C++ and Fortran Matrix Library.

Mathematics

histcounts function for binning numeric data

The histcounts function sorts data into bins with data-dependent bin picking and options for bin control and normalization.

triangulation functions nearestNeighbor and pointLocation for identifying the closest vertex and enclosing triangle or tetrahedron for specified point

The nearestNeighbor function identifies the closest vertex to a query point, and the pointLocation function identifies the enclosing triangle or tetrahedron for a query point.

Option for interpolating to 'next' and 'previous' neighbors with the interp1 function and griddedInterpolant class

The interp1 function and griddedInterpolant class now have 1-D support for interpolating to 'next' and 'previous' neighbors.

The computation time and memory requirements for 'next' and 'previous' are the same as 'nearest'.

Option for rounding numbers to a specified number of decimal or significant digits using the round function

The round function can now round to any specified number of decimal or significant digits.

For example, you can round pi to 2 decimal digits:

round(pi,2)
ans =

    3.1400

Or, you can round pi to 2 significant digits:

round(pi,2,'significant')
ans =

    3.1000

boundary function and alphaShape class for creating a conforming boundary around a discrete set of points

The boundary function and alphaShape class create enveloping boundaries, polygons, or polyhedra around a discrete set of 2-D or 3-D points, including options for tightening or loosening the boundaries around the points.

cummin and cummax functions for computing cumulative minimum and maximum of an array

The cummax and cummin functions compute the cumulative maximum and minimum values in an array. For example,

A = magic(4)

A =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

B = cummin(A)

B =

    16     2     3    13
     5     2     3     8
     5     2     3     8
     4     2     3     1

C = cummax(A)

C =

    16     2     3    13
    16    11    10    13
    16    11    10    13
    16    14    15    13

Reverse accumulation option for the cumsum, cummin, cummax, and cumprod functions

The 'reverse' option for cumsum, cumprod, cummin, and cummax reverses the direction of cumulation, working from end to 1 in the active dimension. This option allows quick directional calculations without requiring a flip or reflection of the input array.

Median and mode calculations of categorical data

The median and mode functions now support categorical arrays as inputs.

Functionality being removed or changed

Functionality

Result

Use Instead

Compatibility Considerations

bitshift(A,k,N)

Errors

bitshift(A,k,assumedtype)

Replace all instances of bitshift(A,k,N) with bitshift(A,k,assumedtype).

bitcmp(A,N)

Errors

bitcmp(A,assumedtype)

Replace all instances of bitcmp(A,N) with bitcmp(A,assumedtype).

histc function

Still Runshistcounts function

Replace all instances of histc with histcounts

Data Import and Export

Faster data import from text files using Import Tool, and readtable and textscan functions

The performance of the Import Tool, the readtable function, and the textscan function improves for text files.

Import of data as categorical and datetime arrays using the readtable and textscan functions

The readtable and textscan functions can read data from text files a categorical or datetime arrays. Use the %C conversion specifier to read text as a category name. Use the %D conversion specifier to read text as a datetime value.

Data import from text files and collections of text files that do not fit into memory with datastore

The datastore function creates a datastore for reading collections of data that are too large to fit in memory. For example, TabularTextDatastore works with collections of text files.

VideoReader performance improvements and ability to start reading from a specified time in the video

The VideoReader.hasFrame and VideoReader.readFrame methods allow for improved performance when reading video files. The methods check for and read the next available frame in the video. You can set the CurrentTime property to begin reading from a specified time in the video file. This simplifies seeking into variable frame-rate video.

Compatibility Considerations

When you first create the VideoReader object, VideoReader no longer automatically populates the NumberOfFrames property . This behavior greatly improves performance, especially for large files. The NumberOfFrames property will be removed in a future release, and is now hidden when displaying the properties of a VideoReader object. When you use the get function to query a VideoReader object, the output structure array now has a CurrentTime field and no longer has a Type field or a NumberOfFrames field. You cannot query the NumberOfFrames property if you have invoked the readFrame or hasFrame methods, or if you have explicitly set the CurrentTime property.

If VideoReader cannot determine the duration of the video file, then the Duration property is empty ([]). Previously the Duration property was set to zero.

tcpclient function for reading and writing data from network connected devices and servers using socket-based connections

TCP, or Transmission Control Protocol, is a highly used networking protocol. The MATLAB TCP/IP client support uses raw socket communication and lets you connect to remote hosts in MATLAB for reading and writing data. For example, you could use TCP/IP to acquire data from a remote weather station, and then plot the data.

You can create a TCP/IP connection to a server or hardware and perform read/write operations. Use the tcpclient function to create the connection, and the write and read functions for synchronously reading and writing data.

webread function for importing online data including JSON, CSV, and image data

The webread function reads content from RESTful Web services. You can use webread to import image, text, and JSON data from Web services into MATLAB. You also can use websave to write data imported from a Web service to file.

Reading non-ASCII encoded files with readtable function

The readtable function can read text files with non-ASCII character encoding schemes. Use the optional 'FileEncoding' name-value pair argument to specify the encoding.

Writing quoted strings with writetable function

The writetable function can write quoted strings to text files. Use the optional 'QuoteStrings' name-value pair argument to enclose MATLAB strings in double quotation marks when writing to a file.

hdftool functionality will not be removed

The R2013a Release Notes originally stated that hdftool would be removed in a future release. As of R2014b, there are no plans to remove this functionality. MATLAB no longer issues a warning when you call hdftool.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
movie2aviStill RunsVideoWriterRemove all instances of movie2avi. Write to AVI files with VideoWriter.
avifileErrorsVideoWriterReplace all instances of avifile with VideoWriter.
avireadErrorsVideoReaderReplace all instances of aviread with VideoReader.
exifreadErrorsimfinfoReplace all instances of exifread with imfinfo.
urlread

Still runs

webreadUse webread only for reading content with HTTP GET requests. To send data using HTTP POST, continue to use urlread.
urlwrite

Still runs

websaveReplace all instances of urlwrite with websave.
read method of VideoReader class

Still runs

readFrame method of VideoReader classReplace all instances of read with readFrame.
NumberOfFrames property of VideoReader class

Still runs

noneRemove all instances of NumberOfFrames. When reading a video file, use the CurrentTime property to specify where reading should begin.
hdfgdStill runsmatlab.io.hdfeos.gdReplace all instances of hdfgd with the corresponding function in the matlab.io.hdfeos.gd package.
hdfsdStill runsmatlab.io.hdf4.sdReplace all instances of hdfsd with the corresponding function in the matlab.io.hdf4.sd package.
hdfswStill runsmatlab.io.hdfeos.swReplace all instances of hdfsw with the corresponding function in the matlab.io.hdfeos.sw package.

Hardware Support

Documentation installation with hardware support package

Starting in R2014b, each hardware support package installs with its own documentation. See Supported Hardware for more information on support packages.

Support package for Android sensors

The MATLAB Support Package for Android™ Sensors allows you to collect sensor data from your mobile Android device and log it in MATLAB. You can then process the sensor data in MATLAB in a variety of ways, including creating plots. You can collect data from the following sensors:

  • Acceleration

  • Angular Velocity

  • Orientation

  • Magnetic Field

  • Position

The Android Sensors product requires the following:

  • MATLAB Mobile™ must be installed on your Android phone. You can acquire this app though the Google Play™ Store.

  • MATLAB is required for creating the connection to the app and logging sensor data.

  • Download and install the MATLAB Support Package for Android Sensors.

The support package includes the command-line interface in MATLAB and the ability to activate the Android Sensors mobile app, which is a separate tab in MATLAB Mobile. You must create a mobiledev object in MATLAB to connect to the sensors on the phone, and collect the data. The connection between your computer running MATLAB and the phone is done via Wi-Fi or your cellular network. To get started, see MATLAB Support Package for Android Sensors.

Support package for Arduino hardware

The MATLAB Support Package for Arduino® Hardware allows you to send and receive data on Arduino devices. You can then process this data in MATLAB in a variety of ways, including creating plots. You can collect data from the following sensors connected to your Arduino hardware:

  • I2C

  • SPI

  • Servo Motors

The support package includes the command-line interface in MATLAB. For more information see MATLAB Support Package for Arduino Hardware.

Support package for LEGO MINDSTORMS EV3 hardware

You can use MATLAB commands to connect to an EV3 brick and perform the following operations:

  • Exchange data with sensors that are connected to the EV3 brick.

  • Control EV3 motors.

  • Interact with the LCD, status light, speaker, and buttons on the EV3 brick.

  • Exchange data with the EV3 brick over USB, Wi-Fi, or Bluetooth.

Graphics

Major update of MATLAB graphics system

Starting in R2014b, the MATLAB graphics system is built on an improved infrastructure with a new look and includes many new features for improved charts and customizations. For more information on the new features and for compatibility considerations, see the remaining graphics release notes.

New look of MATLAB graphics with improved clarity and aesthetics

MATLAB graphics has a new look with many enhancements and new features, including:

  • A new default colormap called parula, a lighter figure background color, and new colors when plotting multiple lines to emphasize plotted data.

  • Anti-aliased fonts and lines for smoother text and graphics. For more information, see the GraphicsSmoothing property for figures and the FontSmoothing property for axes and text objects.

  • New axes properties for setting the grid line colors and for controlling the title and axis label font sizes. For more information, see the GridColor, TitleFontSizeMultiplier, and LabelFontSizeMultiplier properties.

  • Filled contour plot enhancements. For example, line breaks around the contour labels make the labels easier to read. Additionally, there are no longer outlines around the data limits, so they are easier to distinguish from contour lines.

Compatibility Considerations

Most of the new look changes are visual differences and should not affect your code. For troubleshooting topics related to the new look, see Why Are Plot Lines Different Colors? and How Do I Make the Graph Title Smaller?.

Improved infrastructure based on MATLAB objects

Starting in R2014b, the MATLAB graphics system is built on an improved infrastructure. Graphics objects now behave like other MATLAB objects:

  • Graphics objects use object handles of various types instead of the numeric handles used in previous releases.

  • Graphics objects support dot notation for getting and setting properties. Property names are case-sensitive when using dot notation.

Compatibility Considerations

Most code written for numeric handles still works with object handles. However, you should not perform operations that assume or require handles to be numeric values. For strategies to update existing code to work with object handles, see Graphics Handles Are Now Objects, Not Doubles.

Rotatable axis tick labels

New axes properties support rotated axis tick labels. For more information, see the XTickLabelRotation, YTickLabelRotation, and ZTickLabelRotation property descriptions.

Automatic update of datetime and duration tick labels with plot function

The plot function now supports the datetime and duration data types. Axis ticks and labels automatically update with the zoom, pan, and resize operations.

histogram function for plotting histograms

The histogram function plots histograms with data-dependent bin picking and options for bin control, normalization, and visualization.

Unlike the hist function, when you specify an output argument with the histogram function, it returns a histogram object that you can use to modify the properties of the histogram. For example, you can change the number of bins, use a different binning algorithm, or normalize the histogram in several ways. For more information, see Using histogram Objects.

animatedline function for creating line animations

The animatedline function optimizes line animations by accumulating and plotting data from a streaming data source.

Display of multilingual text and symbols

Axis tick labels support TeX and LaTeX markup for special characters, such as superscripts, subscripts, and Greek letters. By default, the axes interprets tick label characters using TeX markup. For more information, see the TickLabelInterpreter property of the axes. You also can use Unicode characters in axis tick labels, as well as in user interface objects.

Support for multiple colormaps in single figure

Figures support using a unique colormap for each axes in the figure. Specify an axes colormap by passing the axes handle to the colormap function.

Pie charts of categorical data with automatic slice labels

Pie charts support categorical data and automatically label the slices.

Image conversion functions rgb2gray and im2double, no longer requiring Image Processing Toolbox

MATLAB now includes the rgb2gray and im2double functions, which previously required the Image Processing Toolbox™. Use rgb2gray to convert RGB images or colormaps to grayscale. Use im2double to convert an image to double-precision values.

imshow function for displaying images from matrices or files, no longer requiring Image Processing Toolbox

MATLAB now includes the imshow function, which previously required the Image Processing Toolbox. Use imshow to display images from matrices or files.

savefig option that creates more compact files

Saving figures in .fig files with savefig creates more compact files using the 'compact' option. Use this option with .fig files to be opened only in MATLAB version R2014b or later.

Compatibility considerations for graphics changes

The graphics changes introduced in R2014b support most of the functionality from previous releases, although there are some differences. Some of the changes that you are most likely to encounter are listed here.

  • Plotting multiple lines with hold on uses the next color in the color order instead of starting from the first color with each plotting command.

  • The Clipping property clips plotted objects to the six sides of the axes box defined by the axis limits. In previous releases, the Clipping property clips objects to the smallest 2-D rectangle that encloses the axes.

  • If you add new data to a graph after using an axis command, such as axis tight, then MATLAB automatically updates the limits to incorporate the new data. In previous releases, MATLAB does not update the axis limits based on changes in the data.

  • Colorbars and legends are no longer axes objects. They are new types of objects with their own sets of supported properties.

  • The Children property for charting objects, legends, and colorbars no longer contains handles to underlying objects.

  • copyobj no longer copies callbacks and application data. If you have existing code that copies object callback properties and object application data, use the copyobj function with the 'legacy' option. This behavior is consistent with versions of copyobj before MATLAB release R2014b.

For troubleshooting topics related to these changes, see Graphics Changes in R2014b. For a list of removed properties and syntaxes, see the tables under Properties and syntaxes being removed or changed and Save and print functionality being removed or changed.

Some graphics features might not work or might be unreliable because of outdated graphics drivers. For the best results with graphics, upgrade to the latest graphics drivers provided by your graphics hardware manufacturer. For more information, see System Requirements for Graphics.

Properties and syntaxes being removed or changed

FunctionalityResultUse InsteadCompatibility Considerations
hold all syntaxStill runs hold onReplace all instances of hold all with hold on.
hist functionStill runshistogram functionUse histogram instead of hist.
colorbar('peer',ax) syntaxStill runscolorbar(ax)Replace all instances of colorbar('peer',ax) with colorbar(ax).
Using 0 to access the root objectStill runsgroot commandUse the groot command to access the root object instead of 0.
EraseMode property for all graphics objectsWarnsNot applicableRemove all instances of the EraseMode property. For more information, see How Do I Replace the EraseMode Property?.
noanimate functionWarnsNot applicableRemove all instances of the noanimate function. For more information, see How Do I Replace the EraseMode Property?.
HitTestArea property for group, transform, and chart objectsErrorsThe PickableParts propertyRemove all instances of the HitTestArea property. To control the area of an object that captures mouse clicks, use the PickableParts property.
Using the vertical slash character (|) in a string to separate text for tick labels or text objectsDoes not separate textUse a cell array of strings, a padded string matrix, or numeric vectorsReplace instances of using the vertical slash character (|) to define multiple strings with a cell array of strings, a padded string matrix, or numeric vectors.
Passing complex inputs to charting functions that do not support complex dataWarns or errorsReal valued input argumentsCharting functions that do not support complex data will warn or error if part of the data is ignored. Pass real valued inputs to these charting functions.
'symbol' option for FontName propertyWarnsUse TeX or LaTex markupRemove all instances of setting the FontName property to 'symbol'. Use TeX or LaTeX markup instead. See the text Interpreter property for more information.
'oblique' option for FontAngle property Uses italic insteadThe 'italic' optionReplace all instances of setting the FontAngle property to 'oblique' with 'italic'.
Using the line function with the dot value ('.') for LineStyle propertyErrorsThe ':' option for dotted linesReplace all instances of setting the LineStyle property to '.' with ':'.
DrawMode axes propertyWarnsThe SortMethod axes propertyRemove all instances of the DrawMode property. Use the SortMethod property instead.
NormalMode property for surface and patch objectsWarnsThe VertexNormalsMode or FaceNormalsMode property Remove all instances of the NormalMode property. Use the VertexNormalsMode or FaceNormalsMode property instead.
lighting phong syntaxUses gouraud lighting insteadlighting gouraudReplace all instances of lighting phong with lighting gouraud.
'phong' value for the EdgeLighting and FaceLighting properties for surface and patch objectsUses gouraud lighting instead'gouraud' option Replace all instances of setting the EdgeColor or FaceColor property to 'phong' with the 'gouraud' value instead.
Using the Children property for the axes to get the text objects for the title and axis labels Does not return these objectsTitle, XLabel, YLabel, and ZLabel axes propertiesThe text objects used for the title and axis labels are no longer children of axes. Use the Title, XLabel, YLabel, and ZLabel properties for the axes to get the text objects instead.
Passing text, image, rectangle, and annotation objects as an input argument to the legend functionErrorsNot applicableRemove all instances of passing these objects to the legend function. Text, image, rectangle, and annotation objects are not included in the legend.
neverselect, autoselect, advise, verbose and quiet inputs for the opengl functionWarnsNot applicableRemove all instances of using these inputs with the opengl function.
'zbuffer' option for the figure Renderer propertyUses OpenGL renderer insteadThe 'opengl' or 'painters' optionsReplace all instances of setting the Renderer property to 'zbuffer' with 'opengl' or 'painters'. The default renderer is 'opengl'.
ResizeFcn figure propertyStill runsSizeChangedFcn figure propertyUse of the ResizeFcn figure property is not recommended. Use the SizeChangedFcn figure property instead.
FixedColors, MinColorMap, WVisual, WVisualMode, XVisual, and XVisualMode figure propertiesErrorsNot applicableRemove all instances of figure properties that are no longer supported. Use supported figure properties.
Selected and SelectionHighlight figure propertiesNo effectNot applicableRemove all instances of the Selected and SelectionHighlight figure properties.
'fullcrosshair' option for the figure Pointer propertyWarnsNot applicableRemove all instances of setting the figure Pointer property to 'fullcrosshair'.
The root properties CommandWindowSize, Diary, DiaryFile, Echo, Format, FormatSpacing, Language, More, RecursionLimit, BeingDeleted, ButtonDownFcn, UIContextMenu, Clipping, CreateFcn, DeleteFcn, BusyAction, Interruptible, HitTest, Selected, SelectionHighlight, and VisibleErrorsNot applicableRemove all instances of root properties that are no longer supported. Use supported root properties. For a list, see Root Properties.
Specifying an output argument for the triplot functionReturns single chart line objectNot applicableSpecifying an output argument for the triplot function returns a single chart line. Remove instances of code that rely on triplot returning multiple chart lines.
Specifying a single output argument for the voronoi functionReturns a vector of two chart line objectsNot applicableSpecifying a single output argument the voronoi function returns a vector of two chart lines. Remove instances of code that rely on voronoi returning more than two chart lines.

Save and print functionality being removed or changed

FunctionalityResultUse InsteadCompatibility Considerations
pagesetupdlg functionWarnsprintpreviewReplace all instances of pagesetupdlg with printpreview.
-crossplatform and -setup options for printdlg functionWarnsNot applicableRemove all instances of using the -crossplatform and -setup options with printdlg.
Using getframe function to capture content outside of the figure windowWarnsSpecify area within figure windowSpecify an area within a figure window when using getframe function.
-dsetup print optionErrorsNot applicableRemove all instances of the -dsetup print option.
'all' option for hgsave and hgload functionsErrorsNot applicableRemove all instances of using hgsave and hgload functions with the 'all' option.
Setting the PaperSize figure property when the PaperUnits figure property is set to 'normalized'ErrorsNot applicableRemove instances of setting the PaperSize property when the PaperUnits property is set to 'normalized'.
mmat option for saveas functionErrorssavefig functionRemove all instances of using the mmat option with saveas. To save a figure to a file, use hgsave with the .fig extension.
printdmfile function and print -dmfile syntaxErrorssavefig function or the figure menuRemove all instances of printdmfile and print -dmfile. To save a figure to a file, use the hgsave function with the .fig extension, or use File > Generate Code on the figure menu instead.
-dill graphics format print optionErrors-depsc or -dsvg print options for vector graphics formatsRemove all instances of using the -dill print option. For vector graphics formats, use -depsc or -dsvg option instead.
-adobecset print optionErrorsNot applicableRemove all instances of the -adobecset print option.
The printer driver options -dbj10e, -dbj200, -dbjc600, -dbjc800, -depson, -deps9high, -depsonc, -ddnj650c, -ddjet500, -dcdjmono, -dcdjcolor, -dcdj500, -dcdj550, -ddeskjet, -dlaserjet, -dljetplus, -dljet2p, -dljet3, -dljet4, -dpxlmono, -dpaintjet, -dpjxl, -dpjetxl, -dpjxl300ErrorsNot applicableRemove all instances of using these print options. To use a particular printer, install the printer driver.
The -dps, -dpsc, -deps, and -depsc print options generate PostScript® Level 3 output instead of PostScript Level 1PostScript Level 3 outputNot applicablePostScript Level 1 output is no longer supported.

GUI Building

uitab and uitabgroup components for creating user interfaces with tabbed panels

The uitab function creates a tabbed panel in which you can group related components together with a clickable tab label. The uitabgroup function creates the container that manages user selection of uitabs.

Changes introduced with new graphics system

The new MATLAB graphics system introduces these changes to the GUI building tools:

  • All GUI components behave like MATLAB objects.

  • Improvements to the stacking behavior of components for more consistent behavior.

  • Improvements to component positioning for more consistency among different components and different platforms.

See Graphics Changes in R2014b for an overview of all the major changes.

Compatibility Considerations

  • In some cases, the conditions and timing of the ResizeFcn callback execution have changed. See Why Has the Behavior of ResizeFcn Changed? for more information.

  • The front-to-back order, or stacking order, of overlapping components might display differently in some GUIs. See Why Are Some Components Missing or Partially Obscured? for more information.

  • GUI objects no longer support the use of handle.listener to create event listeners. See Why Does handle.listener Return an Error? for more information.

  • The layout of UI components might change if you specify units in your code. Set the Units property before the Position property to ensure that MATLAB interprets the Position property values in those units. If you specify the Units property after the Position property, MATLAB interprets the Position values in the current units and converts the values to the equivalent values in the units you specified.

  • Figure annotations and child objects of uipanels cannot cross uipanel boundaries. Previous versions of MATLAB allow annotations and child objects to extend into (or out of) the uipanel boundaries. Now, these items clip at the uipanel boundary. Annotations and child objects of uibuttongroups behave the same way when they encounter a uibuttongroup boundary.

  • The waitforbuttonpress function is now figure-specific. The figure that is current when you call the waitforbuttonpress function is the only area in which users can press a key or click a mouse button to resume program execution. If you need to support multiple open figures, then use the gcf function to determine the current figure when you call waitforbuttonpress.

Functionality being removed or changed

FunctionalityResultUse InsteadCompatibility Considerations
selectmoveresizeNo effectploteditReplace all instances of selectmoveresize with plotedit.
The Selected and SelectionHighlight properties of figure, uicontrol, uitable, uipanel, uibuttongroup, uipushtool, and uitoggletool.No effectNot applicableRemove all instances that use the Selected and SelectionHighlight properties.
See Properties and syntaxes being removed or changed for more information about all the changes to figure properties.
The ResizeFcn property of figure, uipanel, and uibuttongroup.Still runsSizeChangedFcn propertyUse of the ResizeFcn property is not recommended. Use the SizeChangedFcn property instead.
See Properties and syntaxes being removed or changed for more information about all the changes to figure properties.
The 'fullcrosshair' option for the figure Pointer propertyWarningNot applicableRemove all instances of setting the figure Pointer property to 'fullcrosshair'.
See Properties and syntaxes being removed or changed for more information about all the changes to figure properties.
The SelectionChangeFcn property of uibuttongroupStill runsSelectionChangedFcn propertyUse of the SelectionChangeFcn property is not recommended. Use the SelectionChangedFcn property instead.
The Clipping property of uicontrol, uitable, and graphics rootErrorNot applicableRemove all instances that use the Clipping property of a uicontrol, uitable, and graphics root.
See Properties and syntaxes being removed or changed for more information about all the changes to root properties.
The 'none' option for the uipanel and uibuttongroup BackgroundColor property.ErrorNot applicableRemove all instances of setting the uipanel or uibuttongroup BackgroundColor property to 'none'.

Performance and Big Data

Big data analysis on your desktop that can scale to Hadoop with mapreduce

The mapreduce function enables analysis of data sets that do not fit in your computer's memory. It is used to process large data sets on your desktop, and can also be extended to run on Hadoop® to process big data. MapReduce is a powerful technique for applying data processing methods to very large data sets, from simple statistics to complex machine learning algorithms.

For more information, including a selection of examples, see MapReduce.

The functionality of mapreduce extends beyond MATLAB with the following products:

  • Access relational databases using Database Toolbox™

  • Increased performance on desktops with Parallel Computing Toolbox™

  • Scaling up to Hadoop using MATLAB Distributed Computing Server™

  • Create deployable archives or standalone applications that run against Hadoop using MATLAB Compiler™

Improved performance for sorting categorical data with sort

The performance of the sort function improves for large categorical array inputs.

typecast function performance improvements with long vectors

The performance of the typecast function improves for long input vectors.

R2014a

New Features, Bug Fixes, Compatibility Considerations

Desktop

Pop-up Command History for recalling, viewing, filtering, and searching recently used commands in the Command Window

The Command History now displays in response to the up arrow (↑) in the Command Window, by default. Previously, the Command History window occupied a designated space on the MATLAB desktop. The following are additional features enhancing the Command History.

  • Colored marks on the left side of the Command History indicate commands that generate errors. These marks are of the same color as error messages in the Command Window.

  • You can perform case-insensitive searches in the Command History, as well as search for partial matches anywhere in a command.

  • You can select multiple commands using Shift + ↑ and rerun them at once. In addition, brackets display on the left side of the Command History to indicate commands processed as a group. Select the bracket to rerun the group.

  • You can filter commands to display only the results that match your search.

  • The Command History can display the command execution time.

For more information, see Command History.

Compatibility Considerations

To view the Command History window in a docked location as in previous releases of MATLAB, click and then select Dock.

There is no longer any performance issue that justifies saving every nth command to the command history file.  Therefore, this option no longer appears in the Command History Preferences. Instead, specify the total number of commands to save. The default is 25,000 commands, but you can specify a value up to 1,000,000. For more information, see Command History Preferences.

The history file is now named History.xml. Previously, it was named history.m. The first time you access an existing history.m file, MATLAB automatically converts it to History.xml, and you do not need to take further action.

Merge option in MATLAB Comparison Tool for resolving differences between text files

When comparing text files in the MATLAB Comparison Tool you can now merge changes from one file to the other. Merging changes can be useful when resolving conflicts between different versions of files.

For details, see Comparing Text Files.

Saving workspace variables and their values to a MATLAB script

MATLAB now provides the ability to save workspace variables to a MATLAB script. Once the script is saved, you can regenerate the workspace variables by running the script. Click Save Workspace on the MATLAB desktop and select MATLAB script (*.m) in the Save as type menu. Alternately, use matlab.io.saveVariablesToScript to perform this operation from the command line.

Variables that cannot be saved to a script are saved to a MAT-file with the same name as that of the script.

Korean and Chinese localization available on Windows and Mac platforms

If the Language setting on your computer is Korean or Chinese, then MATLAB now has a localized user interface and documentation.

Korean and Chinese documentation is also available on the Web. For details, see Korean and Chinese Documentation.

MathWorks file properties displayed for .SLX, .SLXP, and .MLAPPINSTALL files in file browsers and search engines on Windows and Mac systems

Users can find and organize MathWorks files that are based on the Open Packaging Conventions format (OPC) directly through the Windows and Mac operating systems. MathWorks OPC files are files with .slx, .slxp, or .mlappinstall file extensions.

Use the Tags property to add custom searchable text to the file.

Language and Programming

Suggested corrections for mistyped, user-defined functions in the Command Window

MATLAB suggests corrections for function names mistyped in the command window. This functionality now includes suggestions for custom, or user-defined, functions on the MATLAB path.

Streamlined MEX compiler setup and improved troubleshooting

mex -setup is no longer necessary in most situations

Setting up mex compilers has been simplified. For most users, there is no longer any need to run mex -setup. mex automatically locates and uses a supported installed compiler.

mex reports selected compiler and success status

mex, by default, identifies the compiler it is using at build time and reports success. To suppress this feature, use the new -silent option. mex still reports errors and warnings, even when you specify -silent.

mex maintains different settings for C and C++

mex maintains different settings for C and C++ compilers.

Compiling for MATLAB engine applications is different

To build an engine application or a standalone application to read MAT-files, use the mex command with the new -client engine option. For more information, see What You Need to Build Engine Applications or What You Need to Build Custom Applications.

mex uses standard quoting and no escape characters

If you specify varname=varvalue parameters when you invoke mex, you no longer need to use double-quotes (") on Windows, or escape the $ character on Linux. To redefine a variable, use MATLAB-style single quotes (') and no escape characters.

mex -setup takes a language setting

mex -setup selects a compiler for a given language, lang. If lang is not specified, mex -setup searches for C compilers.

Compatibility Considerations

  • Do not use the -f option to build engine and MAT-file applications. Use the -client engine option instead.

  • The format of the mex configuration files has changed. If there is a .bat or .sh options file in the current or prefdir folder, MATLAB displays a warning. In a future release, these warnings will become errors.

  • Informational messages from mex have changed. The mex command displays the selected compiler and success status. To suppress these messages, use the -silent option.

  • The output of the mex -setup command has changed. Use mex -setup to change the default compiler for a given language. For more information, see Changing Default Compiler.

  • The mex -setup syntax has changed. You can specify a language. If none is specified, mex -setup uses C.

Multidimensional array support for flipud, fliplr, and rot90 functions

The flipud, fliplr, and rot90 functions now support arrays with any number of dimensions. These functions operate independently on the planes formed by the first and second dimensions.

Option for circshift to operate on a specified dimension

The syntax circshift(A,K,dim) allows you to shift the elements of array A by K positions along dimension dim. For more information, see the reference page for circshift.

Compatibility Considerations

The behavior of Y = circshift(A,K) for scalar K will change in a future release. Currently, the function acts on the first dimension of A by default. In a future release, the function will operate on the first dimension of A whose size does not equal 1 by default. To retain current behavior, use circshift(A,[K 0]).

Changes to empty string matching with validatestring

validatestring now validates empty strings.

V = validatestring('',{'Cantor','','Koch'})
V =

     ''

In versions of MATLAB prior to R2014a, the call to validatestring results in an error.

Compatibility Considerations

Change code that relies expects an error when testing the validity of an empty string.

matlab.lang.makeValidName and matlab.lang.makeUniqueStrings functions for constructing unique MATLAB identifiers

The matlab.lang.makeValidName function returns valid MATLAB identifiers from input strings. The output names are not guaranteed to be unique. For example,

S = {'Item#','Item#','Price/Unit','1st order','Contact'};
N = matlab.lang.makeValidName(S)
N = 

    'Item_'    'Item_'    'Price_Unit'    'x1stOrder'    'Contact'

The matlab.lang.makeUniqueStrings function returns unique strings from input strings. For example,

S = {'coffee' 'tea' 'coffee' 'water' 'coffee'};
U = matlab.lang.makeUniqueStrings(S)
U = 

    'coffee'    'tea'    'coffee_1'    'water'    'coffee_2'

Use these two new functions together to ensure that output strings are valid and unique MATLAB identifiers. For example,

S = {'Item#','Item#','Price/Unit','1st order','Contact'};
N = matlab.lang.makeValidName(S);
U = matlab.lang.makeUniqueStrings(N,{},namelengthmax)
U = 

    'Item_'    'Item__1'    'Price_Unit'    'x1stOrder'    'Contact'

details function displays details about arrays

For more information, see details.

Changes to passing empty object to isprop

Calls to isprop with empty objects now return an empty logical array instead of false.

Compatibility Considerations

Change code that relies on isprop retuning false for empty objects.

Behavior change of fullfile function output

In R2012b and earlier, the fullfile function returns a full file specification that includes repeated file separators and relative path symbols if the input file parts include them. For example, repeated file separators include \\ and \\\. Relative path symbols include the dot (.) and double-dot (..) notation.

As of R2013a, fullfile collapses inner repeated file separators and relative directories indicated by the dot and double-dot symbols, and does not display those symbols in the output full file specification. fullfile maintains repeated file separators only if they appear at the beginning of the full file specification. fullfile maintains dot and double-dot symbols only if they appear at either end of the full file specification.

For example, the commands,

f = fullfile('C:\foo\folder1', '..\folder2')
g = fullfile('C:\foo\folder1', '\\\folder3\\')
h = fullfile('\\folder4\.')

return:

f =
C:\foo\folder2

g =
C:\foo\folder1\folder3\

h =
\\folder4\. 

In R2012b and earlier, the same commands returned:

f =
C:\foo\folder1\..\folder2

g =
C:\foo\folder1\\\folder3\\

h =
\\folder4\.

Compatibility Considerations

Change code that relies on locating exact strings containing repeated file separators or dot and double-dot symbols in a full file path.

Support array-creation functions in your class

Class authors can add support to their classes for the array creation functions (ones, zeros, rand, eye, NaN, inf, true, false, cast, rand, randn, and randi). This support includes the class name and prototype object syntaxes. For more information, see Class Support for Array-Creation Functions.

Custom plugins in unit testing framework

The matlab.unittest testing framework provides an interface class, matlab.unittest.plugins.TestRunnerPlugin, to create custom plugins and extend the TestRunner. For more information, see Write Plugins to Extend TestRunner and Create Custom Plugin.

Test parameterization and selection in unit testing framework

Test authors can write tests that are parameterized to combine and execute over lists of data. For more information, see Create Basic Parameterized Test and Create Advanced Parameterized Test.

The matlab.unittest.TestSuite.selectIf method, combined with classes in the matlab.unittest.selectors package, allows for the improved selection of tests included in the test suite.

matlab.unittest plugin for Test Anything Protocol (TAP) output

The matlab.unittest testing framework provides a plugin that produces a Test Anything Protocol (TAP) stream. This plugin allows integration of MATLAB unit test results into third-party systems that recognize the Test Anything Protocol such as continuous integration systems. For more information, see the matlab.unittest.plugins.TAPPlugin documentation.

Output stream direction for matlab.unittest plugins

The matlab.unittest testing framework provides a means to redirect text output from several plugins to standard output (ToStandardOutput) or to a file (ToFile). Output stream direction is supported for the DiagnosticsValidationPlugin, FailureDiagnosticsPlugin, TAPPlugin, and TestSuiteProgressPlugin plugins.

Additionally, the OutputStream class provides an interface for test authors to create custom output streams.

Comparator for MATLAB objects in unit testing framework

The PublicPropertyComparator can be used with the IsEqualTo constraint to compare public properties of MATLAB objects recursively.

Changes to compiler support for building MEX-files

MATLAB supports Visual C++® 2013 compilers for building MEX-files on Microsoft® Windows 32- and 64-bit platforms.

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 website.

Changes to External Programming Language Interfaces documentation

External Programming Language Interfaces documentation is divided into two new categories in Advanced Software Development.

  • Calling External Functions—How to use functionality from other languages, such as Java, .NET, and C, in MATLAB.

  • MATLAB API for Other Languages—How to interact with MATLAB and MATLAB data types from other language applications. How to write and call MEX-functions.

Functionality being removed or changed

Functionality

What Happens When You Use This Functionality?

Use This Instead

Compatibility Considerations

circshift(A,K) for scalar K.

Still runs

circshift(A,[K 0]) to retain current behavior

In a future release, the behavior of circshift(A,K), where K is a scalar, will change. The function will operate on the first array dimension whose size does not equal 1 by default. Currently, the function operates on the first array dimension by default.

To retain current behavior, use circshift(A,[K 0]).

flipdim(A,dim)

Still runs

flip

Replace all instances of flipdim(A,dim) with flip(A) or flip(A,dim).

bitmax

Warns

flintmax

Replace all instances of bitmax with flintmax.

tstool

Errors

timeseries, tscollection, openvar, or plot

Replace all instances of tstool with timeseries, tscollection, openvar, or plot.

To create a time series object, use timeseries.

To create a time series collection with one or more timeseries objects, use tscollection.

To open a time series object or collection in the Variables editor, use openvar.

To plot a time series object, use plot.

genvarname

Still runs

matlab.lang.makeValidName and matlab.lang.makeUniqueStrings

Replace all instances of genvarname with matlab.lang.makeValidName and matlab.lang.makeUniqueStrings. For example,

S = {'my.Name','my_Name','my_Name'};
N = matlab.lang.makeValidName(S);
U = matlab.lang.makeUniqueStrings(N,...
    {},namelengthmax);

depdir

Warns

matlab.codetools.requiredFilesAndProducts

Replace all instances of depdir with matlab.codetools.requiredFilesAndProducts. However, matlab.codetools.requiredFilesAndProducts returns the full path of a required file, including the file name.

depfun

Warns

matlab.codetools.requiredFilesAndProducts

Replace all instances of depfun with matlab.codetools.requiredFilesAndProducts. However, matlab.codetools.requiredFilesAndProducts does not identify opaque classes, such as Java or COM classes. There is no replacement for this functionality.

createCopy method of inputParser class

Errors

copyReplace all instances of createCopy with copy.

mex -f filepath\mexopts.bat

mex -f filepath/mexopts.sh

Warns

For building engine and MAT-file applications, use mex -client engine.

Replace custom mex options files with mex command-line options.

mexIsGlobal in the C/C++ and Fortran MEX API Library

Always returns false

mxIsFromGlobalWS in the C/C++ Matrix Library API and Fortran Matrix Library API

Replace all instances of mexIsGlobal with mxIsFromGlobalWS in MEX-files.

Mathematics

isdiag, isbanded, issymmetric, ishermitian, istril, istriu, and bandwidth functions for testing matrix structure

The following functions test various aspects of matrix structure and are useful in simplifying numerical algorithms.

  • ishermitian determines if a matrix is Hermitian or skew-Hermitian.

  • issymmetric determines if a matrix is symmetric or skew-symmetric.

  • istriu determines if a matrix is upper-triangular.

  • istril determines if a matrix is lower-triangular.

  • isdiag determines if a matrix is diagonal.

  • bandwidth returns the upper and lower bandwidth of a matrix.

  • isbanded determines if a matrix is within the specified upper and lower bandwidths.

sylvester function for solving the Sylvester equation

The sylvester function solves the Sylvester equation, AX + XB = C, for X.

Option for eig function for computing left eigenvectors

The eig function can now calculate the left eigenvectors of a matrix A explicitly.

For example:

A = magic(3);
[V,D,W] = eig(A)
V =

   -0.5774   -0.8131   -0.3416
   -0.5774    0.4714   -0.4714
   -0.5774    0.3416    0.8131


D =

   15.0000         0         0
         0    4.8990         0
         0         0   -4.8990


W =

   -0.5774   -0.7416   -0.0749
   -0.5774    0.6667   -0.6667
   -0.5774    0.0749    0.7416

This produces a full matrix, W, whose columns are the left eigenvectors of A such that W'*A = D*W'.

Option for rand, randi, and randn functions for creating arrays of random numbers that match data type of an existing variable

The functions rand, randi, and randn can now return output that matches the data type of an existing variable.

For example:

A = int16(32);
r = randi(A,4,4,'like',A);
class(r)
ans =

int16

Integer type support for mean

The mean function now supports inputs of any integer data type.

complex function with one complex input

The complex function now supports one complex input. If X is complex, then z = complex(X) is identical to X. In previous releases, complex returned an error.

Change to ind2sub and sub2ind functions with nondouble inputs

The output behavior of the ind2sub and sub2ind functions has changed. The new output of these functions always has class double regardless of the class of the input.

Compatibility Considerations

In previous releases, the output class of these functions was dependent on the input class. To obtain nondouble output, cast the output into the required class, such as int8(sub2ind(size,i,j))).

Data Import and Export

Webcam support for previewing and acquiring live images and video

You can use the MATLAB Webcam support to bring live images from any USB Video Class (UVC) Webcam into MATLAB. This includes Webcams that might be built into laptops or other devices, as well as Webcams that plug into your computer via a USB port.

With simple MATLAB functions you can detect your connected Webcams, acquire single snapshots from a Webcam, and optionally set up a loop of acquired images. The webcamlist function allows you to detect the connected Webcams. The webcam function creates the Webcam object that is used to acquire images. And the snapshot function returns a single image from the camera. You can also preview your image and set properties for the image.

The Webcam support is available only through the Hardware Support Packages. You must download and install the necessary files using the Support Package Installer. To open the Support Package Installer, type supportPackageInstaller in MATLAB. Then on the Select support package to install screen, select the USB Webcams from the list. For more information on installing this support package, see Installing the Webcam Support Package.

The MATLAB Webcam support can be used on the following platforms:

  • Microsoft Windows 32-bit and 64-bit

  • Mac OS X 64-bit

  • Linux

For more information about using the Webcam feature, see

Raspberry Pi hardware support for controlling devices such as motors and actuators, and for capturing live data from sensors and cameras directly from MATLAB

You can use MATLAB commands to connect to a Raspberry Pi™ board over a network and perform the following operations:

  • Exchange data with sensors and actuators that are connected to the GPIO, serial port, I2C, and SPI interfaces

  • Record video and take photographs using the Camera Board

  • Issue Linux shell commands

  • Transfer files to or from your host computer

  • Control the on-board LED

To install or update this support package, perform the steps described in Install Support for Raspberry Pi Hardware.

For more information, see Raspberry Pi Hardware.

readtable improvements for reading spreadsheet and text files

  • The readtable function now automatically recognizes .xlsb, .xlsm, .xltm, .xltx, and .ods as file extensions for spreadsheet files. You no longer need to specify the 'FileType','spreadsheet' name-value pair argument when reading files with these extensions.

  • The readtable function can now read from text files without a file extension. Previously, readtable searched for a file with a .txt extension.

  • On systems with Excel® for Windows, the readtable function can read spreadsheet files in basic mode, using the 'Basic' name-value pair argument. Basic mode is the default for systems without Excel for Windows.

Compatibility Considerations

If you specify a file name with no extension, for example, foo, the readtable function reads foo as a text file, if it exists. If foo does not exist, then readtable searches for and reads from foo.txt. In R2013b, readtable reads only from the file named foo.txt.

To read from a file with a .txt extension when an identically named file without an extension also exists, specify both the file name and extension in the call to readtable.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
aufinfoWarnsaudioinfoReplace all instances of aufinfo with audioinfo.
aureadWarnsaudioreadReplace all instances of auread with audioread.
auwriteWarns Write audio files using audiowrite.
wavfinfoWarnsaudioinfoReplace all instances of wavfinfo with audioinfo.
wavreadWarnsaudioreadReplace all instances of wavread with audioread.
wavwriteWarnsaudiowriteReplace all instances of wavwrite with audiowrite.
wavplayErrors audioplayer and playReplace all existing instances of wavplay with audioplayer and play.
wavrecordErrorsaudiorecorder and recordReplace all existing instances of wavrecord with audiorecorder and record.
mmreaderErrorsVideoReaderReplace all instances of mmreader with VideoReader.

GUI Building

Panel Display in GUIDE Layout Area

While designing a GUI with GUIDE, if you place a panel on top of controls, the layout remains as you specify in the layout area. However, in the running GUI, the panel displays under the controls.

Compatibility Considerations

Previously, if you placed a panel on top of controls in the layout area, the panel automatically moved under the controls in the design area and appeared under the controls in the running GUI. Now, the panel remains as you place it in the layout area, but displays under the controls in the running GUI. The best practice is to place the panel in the layout area first, and then place the controls in the panel. This way, the design area matches the appearance of the running GUI. For existing GUIs, you can right-click the panel in the design area, and then select Send to Back.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
HitTest, Selected, and SelectionHighlight properties for these components:
  • figure

  • uicontrol

  • uipanel

  • uibuttongroup

  • uipushtool

  • uitable

  • uitoggletool

  • uitoolbar

Still runsNot applicableUse of the HitTest, Selected, and SelectionHighlight properties is not recommended for the listed components. These properties might be removed from these components in a future release.

Performance

conv2 function performance improvements with three inputs

The performance of the conv2 function improves when using the conv2(h1,h2,A) syntax.

filter function performance improvements for FIR and IIR

The performance of the filter function, filter(b,a,X), improves in the following cases:

  • where a is a scalar and X is a sufficiently long vector (FIR filter)

  • where a is a vector and X is a vector, matrix, or multidimensional array (IIR filter)

R2013b

New Features, Bug Fixes, Compatibility Considerations

Language and Programming

table data container for managing, sorting, and filtering mixed-type tabular data

table is a new data type to collect mixed-type data and metadata properties, such as variable names, row names, descriptions, and variable units, in a single container. Tables are suitable for column-oriented or tabular data that is often stored as columns in a text file or in a spreadsheet. For example, you can use a table to store experimental data, with rows representing different observations and columns representing different measured variables.

Tables consist of rows and column-oriented variables. Each variable (column) in a table can have a different data type and a different size with the restriction that each variable must have the same number of rows. For example,

T = 

                Gender    Age    Smoker     BloodPressure 
                ------    ---    ------    ---------------
    Smith       'M'       38     true      124          93
    Johnson     'M'       43     false     109          77
    Williams    'F'       38     false     125          83
    Jones       'F'       40     false     117          75
    Brown       'F'       49     false     122          80

For more information, see Tables.

categorical array for ordered and unordered categorical data

categorical is a data type to store data with values from a finite set of discrete categories. A categorical array provides efficient storage and convenient manipulation of nonnumeric data, while also maintaining meaningful names for the values. Ordinal categorical arrays are a type of categorical array whose categories have a mathematical order. For example,

myCategorical = 

     medium      large      small      small      medium 
categories(myCategorical)
ans = 

    'small'
    'medium'
    'large'

You can use categorical arrays in a table to select groups of rows. For more information, see Categorical Arrays.

timeit function for robust time estimates of function execution

The timeit function measures the time required to run a function. It provides a more robustly computed time estimate than tic/toc.

localfunctions function for getting handles to all local functions in a file

The localfunctions function returns a cell array of function handles to all local functions in the current file.

Functions for writing, executing, and verifying tests using the matlab.unittest testing framework without creating custom classes

As an alternative to writing object-oriented tests, the MATLAB xUnit-style testing framework now provides function-based writing, execution, and verification of tests. For more information, see Unit Testing Framework. For an example of function–based test writing, see Write Simple Test Case Using Functions.

matlab.mixin.CustomDisplay utility class to write custom display methods

Use the matlab.mixin.CustomDisplay class to customize object display for your MATLAB class.

flip function, a faster and more memory efficient alternative to flipdim for flipping arrays and vectors

The flip function provides a faster and more memory efficient alternative to flipdim for flipping arrays and vectors.

Partial name matching in inputParser

The inputParser now includes the PartialMatching property, which allows partial matching of parameter names. This property is true by default. For more information, see the inputParser reference page.

Compatibility Considerations

Parsing schemes requiring exact parameter name matching should set the inputParser PartialMatching property to false.

Additional validateattributes options for checking array values

The validateattributes function now checks the following additional attributes of numeric or logical input arrays.

Attribute

Description

'decreasing'

Each column element is less than the previous element and no element is NaN.

'increasing'

Each column element is greater than the previous element and no element is NaN.

'nondecreasing'

Each column element is greater than or equal to the previous element and no element is NaN.

'nonincreasing'

Each column element is less than or equal to the previous element and no element is NaN.

For more information, see the validateattributes reference page.

Conversion changes of out-of-range numbers passed to Java methods that take integers

MATLAB R2013b changes the way it converts out-of-range values for the following Java integer types:

  • Signed 32-bit integer (Java int, short or byte parameters)

  • Signed 64-bit integer (Java long parameters)

For a description of the conversion, see Converting Numbers to Integer Arguments.

Compatibility Considerations

If your MATLAB code can pass out-of-range values to Java methods with integer type arguments, the results might change. For example, the following value, val, is out-of-range for the argument to java.lang.Integer.

val = uint32(2^31);
java.lang.Integer(uint32(val))

In previous versions of MATLAB, the result is:

ans =
 
-2147483648

As of MATLAB R2013b, the result is:

ans =
 
-1

Additional properties for mex.getCompilerConfigurations function

The mex.getCompilerConfigurations function returns the following new properties:

  • ShortName — Character string used to identify options file for the compiler

  • MexOpt — Name and full path to options file

  • Priority — The priority of this compiler

Changes to compiler support for building MEX-files

MATLAB no longer supports the following compilers on Microsoft Windows platforms:

  • Intel® C++ Version 11

  • Intel Visual Fortran Version 11

  • Open Watcom C/C++

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 website.

Changes to time alignment for time series objects

The IsTimeFirst property for time series objects is now read only. The property value is false for 3-D and higher dimensional data. Otherwise, the value is true.

  • true — The first dimension of the data array is aligned with the time vector. For example, ts = timeseries(rand(3,3),1:3);

  • false — The last dimension of the data array is aligned with the time vector. For example: ts = timeseries(rand(3,4,5),1:5);

Consequently, the alignment of the Time property with the first or last data dimension of the Data property is based on the number of dimensions of the data. When the data contains three or more dimensions, the length of the Time property matches the size of the last data dimension. Otherwise, the length of the Time property matches the size of the first data dimension.

Compatibility Considerations

You receive an error when creating a time series object with 3-D or higher dimensional data and with time alignment along the first dimension.

To preserve the property value of true for IsTimeFirst with 3-D or higher dimensional data, reshape the data array to two dimensions, such that the last data dimension and the time dimension are compatible. For example, replace timeseries(ones(10,4,2),1:10) with timeseries(ones(10,8),1:10).

To preserve the number of dimensions of a 3-D or higher dimensional data array, use permute to reorder the data array, such that the size of the last data dimension aligns with the time vector.

Furthermore, you receive a warning when loading a time series object from a prior release with 3-D or higher dimensional data and with time alignment along the first dimension. In this case, MATLAB preserves the time alignment with the first dimension and reshapes the data to 2-D.

New fixture and plugin features for matlab.unittest testing framework

The matlab.unittest testing framework now provides four customized fixtures to ease the creation of setup and teardown code. You can use these fixtures to change the current working folder, add a folder to the MATLAB path, suppress the display of warnings, and create a temporary folder. For more information, see matlab.unittest.fixtures.

To share these fixtures across test classes, use the new SharedTestFixtures class attribute of TestCase. The getSharedTestFixtures method of TestCase provides access to the shared fixtures. You also can use fixtures within a test function by calling the applyFixture method of TestCase.

To pause execution of a test and enter debug mode upon a failure or uncaught error, you can add the new plugin, StopOnFailuresPlugin to the test runner. For more information, see matlab.unittest.plugins.

Conversion of error and warning message identifiers

For R2013b, 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:InputParser:MustBeChar identifier has changed to display either MATLAB:InputParser:MustBeChar or MATLAB:InputParser:ParamMustBeChar. If your code checks for MATLAB:InputParser:MustBeChar, you might need to update it to check for MATLAB:InputParser:ParamMustBeChar instead. For a mapping of the new identifiers to the original identifiers, see Technical Support solution 1-ERAFNC.

Functionality being removed or changed

Functionality

What Happens When You Use This Functionality?

Use This Instead

Compatibility Considerations

addParamValue method of inputParser class

Still Runs

addParameter

Replace all instances of addParamValue with addParameter.

tstool

Warns

timeseries, tscollection, openvar, or plot

Replace all instances of tstool with timeseries, tscollection, openvar, or plot.

To create a time series object, use timeseries.

To create a time series collection with one or more timeseries objects, use tscollection.

To open a time series object or collection in the Variables editor, use openvar.

To plot a time series object, use plot.

Time series object with 3-D or higher dimensional data and time aligned with the first dimension

Errors

Time series object with 2-D data and time aligned with the first dimension or a time series object with 3-D or higher dimensional data and time aligned with the last dimension

For more information about updating your code and assessing the impact of this change, see Changes to time alignment for time series objects.

cat(0,A,B)

Errors

cat(1,A,B)

In previous releases, the cat function silently changed dim=0 to dim=1. Now, cat returns an error when dim=0. Replace all instances of cat(0,A,B) to cat(1,A,B).

cat(z,A,B), where z is a complex number

Errors

cat(real(z),A,B)

In previous releases, the cat function silently used the real part of dim. Now, cat returns an error when dim is complex. Replace all instances of cat(z,A,B) to cat(real(z),A,B).

mexIsGlobal in the C/C++ and Fortran MEX API Library

Still Runs

mxIsFromGlobalWS in the C/C++ Matrix Library and Fortran Matrix Library

Replace all instances of mexIsGlobal with mxIsFromGlobalWS in MEX-files.

Desktop

Improved viewing and editing of one-dimensional structure arrays in the Variables editor

One-dimensional (n-by-1 or 1-by-n) structure arrays in the Variables editor now display field contents arranged in columns, in a single pane. You can reorder fields by dragging a column.

The new display allows you to work with one-dimensional structure arrays as you would with other workspace variables. For example, you can edit field values in-place, create new variables from a selection, and plot selected data using the options on the Plots tab.

For more information about editing structure arrays using the Variables editor, see Edit Table and Structure Array Data Interactively

Improved management of a large number of open files, figures, and documentation pages

Files, docked figures, and documents each display in separate tabs that you can rearrange. For example, each file displays on a tab in the MATLAB Editor.

A drop-down list provides quick access to tabs that do not fit in the window when a large number of files, figures, or documents are open. When viewing multiple documents in a tiled layout, you can drag tabs to create new tiles or move documents between existing tiles. The tabs replace the document bar that was shared across tiles in earlier versions of MATLAB.

Expand all option for opening collapsed sections in documentation pages for printing and in-page searching

Some documentation pages include sections that are collapsed by default, such as input argument descriptions or examples. In-page searches do not find terms in those sections unless you first expand the sections. In R2013b, you can easily expand all sections on a page by clicking expand all in page, which is located at the top right of pages with collapsed sections. Then, you can search for terms anywhere on the page, or print the page in its entirety.

Java integration updated to version 7, providing access to new Java features and bug fixes

As of R2013b, support for the Oracle Java Runtime Environment (JRE™) has been updated to Java 7 Update 11 on all platforms.

Bundling of Java on Mac, removing dependency on Apple supplied Java runtime

The Mac version of MATLAB is no longer dependent on the Apple-provided JRE.

Enhanced print options on Mac operating systems

On Macintosh systems, the Print dialog box now provides more print options. You can access all print options provided by the native Macintosh print dialog. For example, you can select the number of pages to print per sheet, add a border or watermark, and print to a PDF file. To access the Print options, press Command+P from the Command Window or the MATLAB Editor.

Compatibility Considerations

Page Setup options, such as paper size and orientation, are no longer accessible from the Print dialog box. To access Page Setup options, select the Editor tab. In the File section, click Print and then select Page Setup. Alternatively, from the Command Window or Editor, use the keyboard shortcut, Command+Shift+P. The Page Setup dialog box opens. In the Settings menu, ensure that Page Attributes is selected.

To access the options previously available from the Page Setup dialog box (such as Layout, Header, and Fonts options), select MATLAB in the Settings menu.

Option for following documentation links to uninstalled products

By default, the Help browser displays only the documentation associated with your installed products. In previous releases, if you used this default and clicked a link to documentation in an uninstalled product, the Help system displayed a "Page Not Found" error. Now, the Help system asks if you want to view the page from the MathWorks Web site. If so, the page opens in the Help browser.

For information on changing the default settings, see Help Preferences.

Preferences dialog box improvements for easier navigation

Options in the left pane of the Preferences dialog box are arranged by product, and alphabetized within each product for simpler navigation. This change does not affect code that calls preferences. To access the Preferences dialog box, click Preferences on the Home tab.

Auto-adjust capability in Variables editor

You now can auto-adjust the column width for elements of numeric, cell, structure, and table arrays in the Variables editor. Point to the border to the right of a column heading, until a double-headed arrow appears. Then, double-click to auto-adjust the width of that column.

MATLAB support added to Windows 7 Default Programs control panel

You can manage MATLAB file associations on Microsoft Windows 7 systems using the Set your default programs option in the Default Programs control panel.

MATLAB no longer supports selective installation of individual file associations.

Japanese localization available on Mac platforms

If your Mac Language setting is Japanese, then MATLAB, Simulink®, and other localized MathWorks products now have a Japanese user interface and documentation.

Mathematics

Functionality being removed or changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations

interp1(X,Y,Xq,[],...) where [] specifies the default interpolation method

Still Runs

interp1(X,Y,Xq,'linear',...)

Replace all instances of interp1(X,Y,Xq,[],...) with interp1(X,Y,Xq,'linear',...).

Passing mixed-orientation vectors to interp2:

Vq = interp2(x,y,V,xq,yq)

Specifically, if one or both of the following are true:

  • One of x and y is a row vector and the other is a column vector.

  • One of xq and yq is a row vector and the other is a column vector.

Still Runs

Construct the full grid with meshgrid first. Alternatively, use griddedInterpolant if you have a large data set.

Modify all instances that pass mixed-orientation vectors to interp2. You can modify your code in one of two ways:

  • Call meshgrid to construct the full grid first.
    [X,Y] = meshgrid(x,y);
    [Xq,Yq] = meshgrid(xq,yq);
    Vq = interp2(X,Y,V,Xq,Yq);

  • Pass the vectors to griddedInterpolant inside a cell array.
    F = griddedInterpolant({x,y},V.');
    Vq = (F({xq,yq})).'

Passing mixed-orientation vectors to interp3:

interp3(x,y,z,V,xq,yq,zq) Specifically, if one or both of the following are true:

  • x, y, and z are a combination of row and column vectors.

  • xq, yq, and zq are a combination of row and column vectors.

Still Runs

Construct the full grid with meshgrid first. Alternatively, use griddedInterpolant if you have a large data set.

Modify all instances that pass mixed-orientation vectors to interp3. You can modify your code in one of two ways:

  • Call meshgrid to construct the full grid first.
    [X,Y,Z] = meshgrid(x,y,z);
    [Xq,Yq,Zq] = meshgrid(xq,yq,zq);
    Vq = interp3(X,Y,Z,V,Xq,Yq,Zq);

  • Pass the vectors to griddedInterpolant inside a cell array.
    V = permute(V,[2 1 3]);
    F = griddedInterpolant({x,y,z},V);
    Vq = F({xq,yq,zq});
    Vq = permute(Vq,[2 1 3]);

Passing mixed-orientation vectors to interpn:

interpn(x1,x2,...,xn,V,x1q,x2q,...,xnq)

Specifically, if one or both of the following are true:

  • x1,x2,...,xn are a combination of row and column vectors.

  • x1q,x2q,...,xnq are a combination of row and column vectors.

Still Runs

Construct the full grid with ndgrid first. Alternatively, use griddedInterpolant if you have a large data set.

Modify all instances that pass mixed-orientation vectors to interpn. You can modify your code in one of two ways:

  • Call ndgrid to construct the full grid first.
    [X1,X2,...,Xn]= ndgrid(x1,x2,...,xn);
    [X1q,X2q,...,Xnq]= ndgrid(x1q,x2q,...,xnq);
    Vq= interpn(X1,X2,...,Xn, V, X1q,X2q,...,Xnq);

  • Pass the vectors to griddedInterpolant inside a cell array.
    F= griddedInterpolant({x1, x2,...,xn}, V);
    Vq= F({x1q, x2q,...,xnq});

interp1(...,'cubic')

Warns

interp1(...,'pchip')

Replace all instances of interp1(...,'cubic') with interp1(...,'pchip')

Passing the 'pp' flag to interp1. For example:

pp = interp1(x,v,'linear','pp');
vq = ppval(pp,xq);

WarnsUse griddedInterpolant to create an interpolating function that is efficient to evaluate in a repeated manner.

Replace all instances of interp1(...,'pp') with griddedInterpolant. For example:

F = griddedInterpolant(x,v,'linear');
vq = F(xq);

bitshift(A,k,N)Warns

bitshift(A,k,assumedtype)

Replace all instances of bitshift(A,k,N) with bitshift(A,k,assumedtype).
bitcmp(A,N)Warns

bitcmp(A,assumedtype)

Replace all instances of bitcmp(A,N) with bitcmp(A,assumedtype).
repmat(A,r1,r2), where r1 and r2 are row vectorsWarnsrepmat(A,[r1 r2])Replace all instances of repmat(A,r1,r2) with repmat(A,[r1 r2]).
repmat(A,empt), where empt is an empty arrayWarnsrepmat(A,1)Replace all instances of repmat(A,empt) with repmat(A,1).
repmat(A,empt1,empt2), where empt1 and empt2 are empty arraysWarnsrepmat(A,1)Replace all instances of repmat(A,empt1,empt2) with repmat(A,1).
repmat(A,n,empt), where empt is an empty arrayWarnsrepmat(A,[n 1])Replace all instances of repmat(A,n,empt) with repmat(A,[n 1]).
repmat(A,empt,n), where empt is an empty arrayErrorsrepmat(A,[n 1])Replace all instances of repmat(A,empt,n) with repmat(A,[n 1]).
repmat(A,col), where col is a column vectorErrorsrepmat(A,col.')Replace all instances of repmat(A,col) with repmat(A,col.').
repmat(A,B), where B is a matrixErrorsbvec = B(1:length(B));
repmat(A,bvec)
Replace all instances of repmat(A,B) with the following code:
bvec = B(1:length(B));
repmat(A,bvec).
repmat(A,B,C), where B and C are matricesErrorsBC = [B C];
bcvec = BC(1:length(BC));
repmat(A,bcvec)
Replace all instances of repmat(A,B,C) with the following code:
BC = [B C];
bcvec = BC(1:length(BC));
repmat(A,bcvec).
Noninteger-valued size inputs for zeros, ones, eye, Inf, NaN, true, false, rand, randi, randn, and cellErrorsInteger valued size inputsReplace all instances of noninteger-valued size inputs with integer-valued size inputs for zeros, ones, eye, Inf, NaN, true, false, rand, randi, randn, and cell. You can use floor for this conversion.
mimofrErrorsNot ApplicableRemove all instances of mimofr from your existing code.

Graphics

Mac support for copying figures in vector formats to other applications

MATLAB for Mac now supports copying figures to other applications in a high-resolution PDF format. If the figure contains uicontrols, then MATLAB uses a TIFF format instead.

savefig for saving figures to FIG-files

savefig saves one or more figures to a FIG-file.

OpenGL workarounds

If MATLAB crashes because of problems with your current version of OpenGL, then use one of the following workarounds:

  • Start MATLAB with the -softwareopengl startup flag to use the software version of OpenGL.

  • Execute the opengl neverselect command in your startup.m file to prevent MATLAB from selecting OpenGL as the renderer.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations

Numeric specifiers to set legend location

Still runs

Supported string specifiers

Remove all instances of using numeric specifiers to set the legend location

get(0,'CommandWindowSize')

Still Runs

matlab.desktop.commandwindow.size

Replace all instances of get(0,'CommandWindowSize') with matlab.desktop.commandwindow.size. The new command is compatible with MATLAB R2013a and later releases.

printdlg('-setup',fig)WarnsUse the operating system printer management utilities to set up a new printerRemove all instances of using printdlg with the -setup option

GUI Building

Custom icons for MATLAB apps you create

You can now package a custom icon in an app that you create. When selecting an icon, click Use your own icon... .

A second dialog box opens. Click Select icon to browse for a custom icon. The dialog box also displays three icon sizes. MATLAB automatically scales your icon for use in the Install dialog, App gallery, and quick access toolbar. For more information, see Package Apps.

Performance

repmat with numeric, char, and logical types

The performance of the repmat function improves when the input array contains numeric, char, or logical values.

Linear algebra functions on computers with new AMD processors

The performance of the linear algebra functions improves on computers with AMD® processors supporting the Intel AVX instruction set.

Data Import and Export

fprintf function prints Unicode characters to the screen

The fprintf function now displays Unicode® characters on the screen. Previously, text was displayed with the user default character encoding, which is dependent on the user locale.

Compatibility Considerations

When displaying non-ASCII text on the screen, the fprintf function might return a different output value for the number of displayed bytes, compared to previous versions of MATLAB. This output value is now equal to the number of characters displayed on the screen.

There are no changes to the behavior of fprintf when writing text to a file, or when printing ASCII text to the screen.

Changes to default encoding for sendmail function

When calling the sendmail function on systems using a Japanese locale, the default character encoding is now UTF-8. Previously, the default encoding was SJIS.

Compatibility Considerations

This change affects only systems that use a Japanese locale. To use the SJIS character encoding, call:

setpref('Internet','E_mail_Charset','SJIS');

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
hdftoolWarns Read data from HDF files using hdfread or the low-level functions in the matlab.io.hdf4.sd, matlab.io.hdfeos.gd, and matlab.io.hdfeos.sw packages.

R2013a

New Features, Bug Fixes, Compatibility Considerations

Desktop

Option to add separators between controls on the quick access toolbar

You can now insert and move separators bars on the quick access toolbar. This helps to organize icons into groups. For information on how to customize and organize icons on the quick access toolbar, see Access Frequently Used Features.

Additional icon choices, auto-scaled thumbnails, and text-formatting options for customizing descriptions of MATLAB apps

When you package an app by clicking the Package App tab on the Apps tab, MATLAB opens the Package app dialog box. In the Describe your app section of the dialog box, you can:

  • Click the app icon , and then select a new icon from the display to represent your app in the Apps gallery.

  • Use formatting options when writing the app description.

    Options include: bold, italic, monospace, and hyperlinked text; bulleted and numbered lists; images.

In addition, MATLAB automatically scales the screenshot you provide when packaging. This screenshot appears in the tooltip MATLAB displays when hovering over an app icon in the App gallery. The screenshot is scaled to fit a 300 x 300 area and maintains its original aspect ratio.

For more information, see Package Apps.

Left-aligned table of contents for navigating in the Help browser and online Documentation Center

The documentation now includes a table of contents that can remain open and that does not overlap the content. View the table of contents by clicking the Contents icon on the left edge of the window.

Search term highlighting and content expansion in the Help browser

In the Help browser, search terms now appear highlighted when you view pages linked from the search results. If the search term occurs within a collapsed section on the page, the browser automatically expands the content.

For example, the reference page for the publish function includes the term bmp in collapsed content. When you search the documentation for bmp, and then select the publish reference page, the Help browser expands the relevant section on the page and highlights all occurrences of the term.

To clear highlights, press the Esc key.

Context menu items in Help and Web browsers for zooming, page navigation, and saving

Both the Help browser and the MATLAB Web browser now provide easy access to commonly used features in their context menus. Right-click within the browser to see the available options, which include zooming to change the font size, searching within a page, navigating back or forward, or saving the HTML to a file.

    Note:   These context menu items are not available on Macintosh systems.

Removal of Handle Graphics support under -nojvm startup option

When you start MATLAB with the -nojvm startup option, Handle Graphics® functionality is not supported. (The -nojvm option is available for UNIX® platforms; see background information on the matlab (UNIX) reference page.)

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.

If you use the -nojvm startup option and use Handle Graphics functionality, MATLAB produces an error.

Compatibility Considerations

To avoid the error, 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 topics in Performance and Memory.

  • If you want to continue to use the -nojvm startup option, remove the code that is now producing the warnings.

-noFigureWindows startup option suppresses figures on Linux and Mac platforms

When you start MATLAB with the -noFigureWindows startup option, MATLAB disables the display of figure windows.

No default keyboard shortcut for overwrite mode

There is no longer a default keyboard shortcut for Overwrite mode, and OVR no longer appears at the bottom right corner of the MATLAB status bar. Previously, the Insert key by default toggled between Insert and Overwrite modes in the Command Window and in the MATLAB Editor.

Compatibility Considerations

To enable Overwrite mode, assign a keyboard shortcut to this action. On the Home tab, in the Environment section, click Preferences > Keyboard > Shortcuts. Search or scroll to find the action name, Toggle Insert/Overwrite Mode, and assign a keyboard shortcut. Use this shortcut to toggle between Insert and Overwrite modes.

Support requests using prerelease versions

If you have Internet access, you can submit a technical support request to MathWorks from MATLAB by selecting Help > Request Support. Previously, this feature was only available in the final version of each release. Beginning with R2013a, this feature is also available in the prerelease version.

Language and Programming

matlab.unittest package, an xUnit-style testing framework for the MATLAB language that allows writing and running unit tests, and analyzing test results

For information about the matlab.unittest package, see Unit Testing Framework.

strsplit and strjoin functions for splitting and joining strings

The strsplit function splits a string into a cell array of strings. The strjoin function joins strings in a cell array into a single string.

Additional validateattributes options for checking array size and shape

The validateattributes function now checks the following attributes of input arrays.

Attribute

Description

'3d'

Array with three or fewer dimensions

'ndims', N

N-dimensional array

'square'

Square matrix

'diag'

Diagonal matrix

For more information, see the validateattributes reference page.

Help text for enumerations and events

The help and doc commands now display help text that you define for enumerations and events in custom classes. For more information, see Create Help for Classes.

Removal of support for .jar documentation files

The Help system no longer extracts documentation from .jar files. All custom documentation must be in uncompressed HTML files.

For more information, see Display Custom Documentation.

Changes to Microsoft .NET Framework support

As of R2013a, the MATLAB .NET interface requires the Microsoft .NET Framework Version 4.0 and above. The interface continues to support assemblies built on Framework 2.0 and above.

Compatibility Considerations

You must have the .NET Framework Version 4.0 or above installed on your system. If you enter any NET. or System. commands on a machine without Framework 4.0, MATLAB displays a warning. To determine if your system has a supported framework, use the NET.IsNETSupported function.

Changes to compiler support for building MEX-files

MATLAB supports these new compilers for building MEX-files.

Microsoft Windows platforms:

  • Visual C++ 2012

  • Intel C++ XE 2013

  • Intel Visual Fortran XE 2013

Mac OS X platforms:

  • Apple Xcode 4.2 and higher with Clang

MATLAB no longer supports the following compiler on Mac OS X platforms:

  • Xcode with gcc

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 website.

Changes to subclasses of built-in classes

Subclasses of built-in classes no longer inherit the following methods:

  • ones

  • zeros

  • true

  • false

  • cast

As a result of this change, you cannot call these methods with an object of a built-in subclass. For example, given a class, mySubclassOfDouble, that derives from double, the following attempt to call cast results in an error:

a = mySubclassOfDouble(1);   % constructor 
b = a.cast('int8');          % ok in R2012b but errors in R2013a 

However, you can call the corresponding built-in functions with objects of the subclass. Use the function syntax instead of the method dot notation syntax:

b = cast(a,'int8');

Compatibility Considerations

Change code that attempts to call these methods to call the built-in function instead. Use function syntax instead of dot notation, as described in the previous section.

Conversion of error and warning message identifiers

For R2013a, 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:addtodate:Nargin identifier has changed to MATLAB:addtodatemx:Nargin. If your code checks for MATLAB:addtodate:Nargin, you must update it to check for MATLAB:addtodatemx:Nargin instead. For a mapping of the new identifiers to the original identifiers, see Technical Support solution 1-ERAFNC.

No strict-match requirements for month formats when converting date strings

When reading date strings, the date functions datenum, datevec, and datestr now treat months expressed as full names, three-letter abbreviations, or numbers in date string inputs interchangeably. In previous releases, the commands fail if a date string input does not match the format input. Using the datestr function to write date strings is not affected.

For example, consider the cell array of date strings, where each date string indicates the month in a different format:

mydates = {'31-October-2012','31-Oct-2012','31-10-2012'};
datevec(mydates,'dd-mm-yyyy')
ans =

        2012          10          31           0           0           0
        2012          10          31           0           0           0
        2012          10          31           0           0           0

Replacing the date string format input, 'dd-mm-yyyy', with 'dd-mmm-yyyy' or 'dd-mmmm-yyyy' returns the same output. Previously, the command failed, because the first two date strings include a full month name and a month abbreviation, which are not strict matches to the mm month format specified.

Compatibility Considerations

The date functions datenum, datevec, and datestr do not error when month formats are inconsistent across multiple date strings in a cell array of strings. When reading a cell array of date strings, you no longer can rely on using a format that includes a field for month name or abbreviation to catch date strings that specify a month number. You should ensure that all date strings in a cell array have the same format to avoid the possibility of confusing day and month numbers. For example,

mydates = {'11-Oct-2012','11-10-2012'};
datevec(mydates,'dd-mmm-yyyy')
ans =

        2012          10          11           0           0           0
        2012          10          11           0           0           0

In R2013a, both dates are silently interpreted as October 11, 2012 although you might have intended '11-10-2012' to be in month-day-year format, representing November 10, 2012.

Date functions error on out-of-range quarter values

Valid values for quarter formats are Q1 through Q4 when converting date strings using the datenum or datevec functions. Values outside this range throw an error. Previously, the date functions accepted values outside the range, such as Q5, but returned incorrect results.

Compatibility Considerations

To prevent errors when parsing quarter values, remove values outside the valid range (Q1 through Q4) from your code.

String representations of large integers using exponential notation

The num2str function converts any large floating-point number that loses precision due to hardware limitations to a string representation that uses exponential notation. Such floating-point numbers are those greater than flintmax. Previously, num2str returned a string representation in decimal notation.

This change in behavior affects only the syntax str = num2str(x). The following example compares the output of num2str in R2013a to R2012b.

R2013aR2012b
num2str(30e+25)
ans =
3e+26
num2str(30e+25)
ans =
300000000000000000000000000

Compatibility Considerations

To obtain a string representation of large integers that uses decimal notation, call int2str(x) instead of num2str(x).

Do not use classpath.txt file to modify Java static path

As of R2012b, the file classpath.txt is no longer used to add custom paths to the static Java class path. A new MathWorks product installation rewrites the static class path (found in the classpath.txt file).

Compatibility Considerations

To modify the Java class path, create javaclasspath.txt or javalibrarypath.txt files. For more information, see The Static Path and Locating Native Method Libraries.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations

createCopy method of inputParser class

Warns

copy

Replace all instances of createCopy with copy.

hostid

Warns

 

See Solution 1–171PI on the MathWorks website for instructions on obtaining your hostid.

Mathematics

scatteredInterpolant and griddedInterpolant support for extrapolation

  • scatteredInterpolant is a new class for interpolating scattered data, and it returns extrapolated values by default when you evaluate at query points outside the convex hull.

  • griddedInterpolant now returns extrapolated values by default when you evaluate at query points outside the domain of your sample grid.

Compatibility Considerations

scatteredInterpolant supports extrapolation by default. This behavior is different from that of TriScatteredInterp, which returns NaN when you evaluate at query points outside the convex hull using the 'linear' or 'natural' methods. To preserve the TriScatteredInterp behavior, set the ExtrapolationMethod property to 'none'. See the scatteredInterpolant reference page for more information.

griddedInterpolant previously returned NaN values when you queried points outside the domain of the sample points using the 'linear', 'cubic' or 'nearest' interpolation methods. Now all interpolation methods support extrapolation by default. To preserve the old behavior, set the ExtrapolationMethod property to 'none' when the interpolation method is 'linear', 'cubic' or 'nearest'. See the griddedInterpolant reference page for more information.

Syntax for ones, zeros, and other functions for creating arrays that match attributes of an existing variable

The functions ones, zeros, eye, Inf, NaN, true, false, and cast now can return an output that matches the data type, sparsity, and complexity (real or complex) of a variable p.

For example:

p = uint8([1 2]);
X = ones(2,3,'like',p);
class(X)
ans =

uint8

Integer type support for prod, cumsum, cumprod, median, mode, and number theory functions

The following functions now support inputs of any integer data type: median, mode, prod, cumprod, cumsum, isprime, primes, factor, gcd, lcm, perms, factorial, nextpow2, and nchoosek.

flintmax function for largest consecutive integer in floating-point format

Largest consecutive integer in floating-point format. flintmax returns the largest consecutive integer in IEEE® double precision, which is 2^53. Above this value, double-precision format does not have integer precision, and not all integers can be represented exactly. flintmax('single') returns the largest consecutive integer in IEEE single precision, which is single(2^24).

Scale option for airy function

scale is an optional flag you can pass to airy to scale the resulting Airy function. See the airy reference page for more information.

scatteredInterpolant class that replaces TriScatteredInterp

TriScatteredInterp will be removed in a future release. Use the new scatteredInterpolant class instead. The scatteredInterpolant class performs interpolation on 2-D and 3-D scattered data with support for extrapolation outside the convex hull of the sample points. scatteredInterpolant also supports queries in grid vector format to conserve memory.

Compatibility Considerations

  • scatteredInterpolant supports extrapolation by default. This behavior is different from that of TriScatteredInterp, which returns NaN when you evaluate at query points outside the convex hull using the 'linear' or 'natural' methods. To preserve the TriScatteredInterp behavior, set the ExtrapolationMethod property to 'none'. See the scatteredInterpolant reference page for more information.

  • scatteredInterpolant does not accept input of type DelaunayTri. Use nearestNeighbor or pointLocation to interpolate using a specific Delaunay triangulation. See Interpolation Using a Specific Delaunay Triangulation for more information.

  • The scatteredInterpolant Points property is the array of sample point coordinates. The corresponding TriScatteredInterp property is called X. Use the Points property to refer to the sample points when you update your code.

triangulation class to replace TriRep

TriRep will be removed in a future release. Use the new triangulation class instead. The triangulation class represents 2-D and 3-D triangulations using a similar form and syntax as TriRep.

Compatibility Considerations

The property names and some method names have changed. The tables below map the current TriRep properties and methods to the triangulation replacements. Each replacement property has the same shape and holds the same values as the corresponding TriRep property. Similarly, each replacement method has the same syntax and returns the same result as the corresponding TriRep method.

Replacements for TriRep Properties

TriRep PropertyReplacement triangulation PropertyName Change
XPoints
TriangulationConnectivityList

Replacements for TriRep Methods

TriRep MethodReplacement triangulation MethodName Change
baryToCartbarycentricToCartesian
cartToBarycartesianToBarycentric
circumcenterscircumcenter
edgeAttachmentsedgeAttachments 
edgesedges 
faceNormalsfaceNormal
featureEdgesfeatureEdges 
freeBoundaryfreeBoundary 
incentersincenter
isEdgeisConnected
neighborsneighbors 
sizesize 
vertexAttachmentsvertexAttachments 

delaunayTriangulation class to replace DelaunayTri

DelaunayTri will be removed in a future release. Use the new delaunayTriangulation class instead. delaunayTriangulation represents 2-D and 3-D Delaunay triangulations using a similar form and syntax as DelaunayTri.

Compatibility Considerations

Some of the property and method names have changed. The tables below map the current DelaunayTri properties and methods to the delaunayTriangulation replacements. Each replacement property has the same shape and holds the same values as the corresponding DelaunayTri property. Similarly, each replacement method has the same syntax and returns the same result as the corresponding DelaunayTri method.

Replacements for DelaunayTri Properties

DelaunayTri PropertyReplacement delaunayTriangulation PropertyName Change
ConstraintsConstraints 
XPoints
TriangulationConnectivityList

Replacements for DelaunayTri Methods

DelaunayTri MethodReplacement delaunayTriangulation MethodName Change
convexHullconvexHull 
inOutStatusisInterior
nearestNeighbornearestNeighbor 
pointLocationpointLocation 
voronoiDiagramvoronoiDiagram 

Set functions behavior change

The behavior of unique, union, intersect, setdiff, setxor, and ismember has changed.

  • If there are repeated elements in the input arrays, the functions unique, union, intersect, setdiff, and setxor return the index to the first occurrence of the repeated elements (or rows).

  • The optional output array, locb, returned by ismember, contains the lowest absolute indices in B for elements (or rows) that are also in A.

  • All index vectors returned by unique, union, intersect, setdiff, or setxor are column vectors.

  • The shape of the output, C, from intersect, setxor, and union, when the 'rows' and 'legacy' flags are not specified, is as follows. C is column vector unless both A and B are row vectors, in which case C is a row vector.

  • The shape of the output, C, from setdiff, when the 'rows' and 'legacy' flags are not specified, is as follows. C is a row vector if A is a row vector. Otherwise, C is a column vector.

  • unique, union, intersect, setdiff, setxor, and ismember support objects.

  • The input arrays passed to union, intersect, setdiff, setxor, and ismember must be of the same class with the following exceptions:

    • Logical, char, and all numeric classes can combine with double arrays.

    • Cell arrays of strings can combine with char arrays.

  • ismember treats trailing white space in cell arrays of strings as distinct characters. For example, 'word' is different from 'word '. If the 'legacy' flag is specified, ismember ignores trailing white space and treats 'word' the same as 'word '.

Compatibility Considerations

If the changes adversely affect your code, you can specify 'legacy' to preserve the behavior from R2012b and prior releases. For example:

[C,IA,IC] = unique([9 9 1])
C =

     1     9


IA =

     3
     1


IC =

     2
     2
     1
[C2,IA2,IC2] = unique([9 9 1],'legacy')
C2 =

     1     9


IA2 =

     3     2


IC2 =

     2     2     1

Functionality being removed or changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations
quadStill runsintegral

Replace all instances of quad with integral.

For example, replace q = quad('x.*cos(x)',0,1) with q = integral(@(x)x.*cos(x),0,1).

If quad uses an absolute error tolerance, tol, replace all instances of the tolerance argument with the 'AbsTol' or 'RelTol' name-value pair arguments.

For example, replace q = quad(fun,a,b,tol) with q = integral(fun,a,b,'AbsTol',tol,'RelTol',tol).

quadlStill runsintegral

Replace all instances of quadl with integral.

For example, replace q = quadl('x.*cos(x)',0,1) with q = integral(@(x)x.*cos(x,0,1).

If quadl uses an absolute error tolerance, tol, replace all instances of the tolerance argument with the 'AbsTol' or 'RelTol' name-value pair arguments.

For example, replace q = quadl(fun,a,b,tol) with q = integral(fun,a,b,'AbsTol',tol,'RelTol',tol).

quadvStill runsintegral with the 'ArrayValued',true name-value pair argumentReplace all instances of quadv with integral using the 'ArrayValued',true name-value pair argument.
dblquadStill runsintegral2

Replace all instances of dblquad with integral2.

If there are discontinuities in the interior of the region of integration, replace dblquad with integral2 using the 'method','iterated' name-value pair argument.

triplequadStill runsintegral3

Replace all instances of triplequad with integral3.

If there are discontinuities in the interior of the region of integration, replace triplequad with integral3 using the 'method','iterated' name-value pair argument.

bitmaxStill runsflintmaxReplace all instances of bitmax with flintmax.
TriRepStill runstriangulationReplace all instances of TriRep with triangulation. Most of the triangulation properties and methods are the same as those in TriRep, but there are a few exceptions. See triangulation class to replace TriRep for details.
DelaunayTriStill runsdelaunayTriangulationReplace all instances of DelaunayTri with delaunayTriangulation. Most of the delaunayTriangulation properties and methods are the same as those in DelaunayTri, but there are a few exceptions. See delaunayTriangulation class to replace DelaunayTri for details.
TriScatteredInterpStill runsscatteredInterpolant

Replace all instances of TriScatteredInterp with scatteredInterpolant. See scatteredInterpolant class that replaces TriScatteredInterp for compatibility details.

inlineStill runsAnonymous functionReplace all instances of inline with an anonymous function. See Anonymous Functions for more information. You can use symvar and func2str to convert your existing code.
rand or randn with the 'seed', 'state' or 'twister' inputs.Still runsrngFor more information about updating your code and assessing the impact of this change, see Updating Your Random Number Generator Syntax.
permute(A,order) where order contains noninteger or complex values.WarnsReal, positive integer values for orderReplace all instances of noninteger or complex valued inputs with real, positive integer values. You can use round or real for this conversion.
Noninteger valued size inputs for zeros, ones, eye, Inf, NaN, true, false, rand, randi, randn, and cellWarnsInteger valued size inputsReplace all instances of noninteger valued size inputs with integer valued size inputs for zeros, ones, eye, Inf, NaN, true, false, rand, randi, randn, and cell. You can use floor for this conversion.
cholinc(X,'inf')ErrorsNoneRemove all instances of cholinc(X,'inf') from your code.
All other syntaxes of cholinc except cholinc(X,'inf')ErrorsicholReplace these instances of cholinc with ichol.
luincErrorsiluReplace all instances of luinc with ilu.
sparse(A)
sparse(i,j,s,...)
where A and s are of type char.
Errorssparse(double(A))
sparse(i,j,double(s),...)
Convert all char inputs to double before calling sparse.
RandnAlg property of RandStream classErrorsNormalTransform property of RandStream classReplace all existing instances of RandnAlg with NormalTransform.
setDefaultStream method of RandStream classErrorssetGlobalStream method of RandStream classReplace all existing instances of RandStream.setDefaultStream with RandStream.setGlobalStream.
getDefaultStream method of RandStream classErrorsgetGlobalStream method of RandStream classReplace all existing instances of RandStream.getDefaultStream with RandStream.getGlobalStream.

Graphics

gobjects function for preallocating graphics handle array

The gobjects function creates an array of graphics handles. Use this function instead of the ones or zeros function when preallocating an array to store graphics handles.

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations

Figure DoubleBuffer property

No effect

No replacement needed

On older computer systems, was used to produced flash-free graph animations.

Use of ginput when MATLAB is started with the–noFigureWindow or –nodisplay flag

Errors

Not applicable

Do not use ginput when you start MATLAB with the –noFigureWindows or –nodisplay flags.

Use of graphics format extensions ai or ill with saveas

Warns

No replacement

Remove all instances of saveas with the ai or ill extensions.

Use of all option with hgsave or hgload

Warns

No replacement

Remove all instances of passing all to hgsave or hgload.

Use of getframe with second input argument that specifies an area not contained in figure window

Warns

No replacement

If using a second input argument with getframe, then specify an area fully contained in figure window.

Use of -dsetup option with print to display the Windows Print Setup dialog

Warns

No replacement

Remove all instances of -dsetup. For the current figure, click File > Print in the Figure window to display the Print Setup dialog.

Data Import and Export

Reading and writing indexed and grayscale AVI files with VideoReader and VideoWriter objects

The VideoReader.read method now returns an array of grayscale data when reading grayscale AVI files. The read method also reads AVI files with indexed video and a colormap using the new 'native' input argument.

The VideoWriter.writeVideo method now writes grayscale AVI files, and AVI files with indexed video and a colormap.

Compatibility Considerations

A VideoReader object created from an AVI file with indexed video and a grayscale colormap now has a VideoFormat property with the value 'Grayscale'. By default, using the  VideoReader.read method to read this object returns an m-by-n-by-1-by-F array, where m is the image frame height, n is the image frame width, and F is the number of frames read. In R2012b and earlier releases, the value of VideoFormat was 'RGB24' and read by default returned an m-by-n-by-3-by-F array.

Writing MPEG-4 H.264 files on Mac with VideoWriter object

VideoWriter now writes MPEG-4 H.264 files with the extension .mp4 or .m4v on systems with Mac OS X 10.7 or later.

Tiff object improvements for reading and writing RGB-class TIFF images

The Tiff.readRGBAImage method returns RGBA data from an entire RGB-compatible image. The Tiff.readRGBAStrip and Tiff.readRGBATile methods return RGBA data from a single strip or a single tile in an RGB-compatible image, respectively.

The JPEGColorMode property for Tiff objects controls YCbCr/RGB conversion when writing YCbCr images. For more information, see the Tiff reference page.

Importing non-ASCII encoded files with textscan function

The textscan function now reads text files with non-ASCII encodings. For a complete list of supported encoding schemes and the syntax for specifying the encoding, see the fopen reference page.

Multichannel JP2 support in imread function

By default, when reading JP2 files, the imread function now returns all image channels in the order in which they exist in the codestream. In R2012b and earlier releases, imread read up to 3 channels only.

Compatibility Considerations

The default syntax of imread no longer reorders the channels of a JP2 image where the channels are out of order. To reorder the channels, call imread with the 'V79Compatible' name-value pair argument.

Previous behavior change of xlsread function output

In R2011b and earlier, the xlsread function returned columns of empty strings, '', in the text data output, where there were leading columns of numeric data preceding text data. As of R2012a, on systems with Excel for Windows, these columns of empty strings are trimmed from the text data output.

Compatibility Considerations

This change in behavior affects file reading on systems with Excel for Windows, when calling xlsread without the 'basic' argument. For example, given a file, myfile.xls , where Sheet1 contains the following data:

1	1	1	A	A
2	2	2	B	B
3	3	3	C	C
4	4	4	D	D
5	5	5	E	E

Calling [num,txt] = xlsread('myfile.xls','Sheet1') on systems with Excel for Windows returns:

num =
     1     1     1
     2     2     2
     3     3     3
     4     4     4
     5     5     5


txt = 
    'A'    'A'
    'B'    'B'
    'C'    'C'
    'D'    'D'
    'E'    'E'

In R2011b and earlier, the command returned:

num =

     1     1     1
     2     2     2
     3     3     3
     4     4     4
     5     5     5


txt = 

    ''    ''    ''    'A'    'A'
    ''    ''    ''    'B'    'B'
    ''    ''    ''    'C'    'C'
    ''    ''    ''    'D'    'D'
    ''    ''    ''    'E'    'E'

When reading XLS files, you can use the 'basic' flag to reproduce the pre-R2012a output:

[num,txt] = xlsread('filename.xls',Sheet,'','basic');

Authentication, user name, and password inputs for urlread and urlwrite functions

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

AttributeValue
AuthenticationHTTP authentication mechanism. Currently, only basic authentication is supported.
UsernameUser identifier.
PasswordUser authentication string.

Additional audio and video file reading capabilities using Import Wizard and importdata function

The Import Wizard and the importdata function now import all audio file formats supported by the audioread function, including WAV, FLAC, and OGG files on all platforms, and MP3 and MPEG-4 AAC files on Windows 7 (or later), Macintosh, and Linux platforms.

The Import Wizard and the importdata function now import all video file formats supported by the VideoReader class.

sound function nonblocking

The sound function now returns immediately. In R2012b and earlier releases, sound blocked until all audio played back. 

Compatibility Considerations

To play audio with blocking, use playblocking(audioplayer(y,Fs)) instead of sound(y,Fs).

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
aufinfoStill runsaudioinfoReplace all instances of aufinfo with audioinfo.
aureadStill runsaudioreadReplace all instances of auread with audioread.
auwriteStill runs Write audio files using audiowrite.
wavfinfoStill runsaudioinfoReplace all instances of wavfinfo with audioinfo.
wavreadStill runsaudioreadReplace all instances of wavread with audioread.
wavwriteStill runsaudiowriteReplace all instances of wavwrite with audiowrite.
cdfwriteStill runs Write Common Data Format (CDF) files using the cdflib low-level functions.
hdftoolStill runs Read data from HDF files using hdfread or the low-level functions in the matlab.io.hdf4.sd, matlab.io.hdfeos.gd, and matlab.io.hdfeos.sw packages.

Performance

fft function performance improvements on computers with new Intel and AMD processors

The fft function performance improves on computers with Intel and AMD processors supporting the AVX instruction set.

permute function performance improvements for 3-D and higher dimensional arrays

The permute function performance improves for 3-D and higher dimensional arrays.

R2012b

New Features, Bug Fixes, Compatibility Considerations

Desktop

Toolstrip that replaces menus and toolbars in MATLAB Desktop

  • 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

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

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

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_experssion == 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 the Supported and Compatible Compilers website.

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 videovideo.

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.

R2012a

New Features, Bug Fixes, Compatibility Considerations

Desktop Tools and Development Environment

Transpose and Sort Variables in the Variable Editor

To transpose or sort variables, use the right-click menu options in the Variable Editor. You can sort variables based on single or multiple column selections. The columns you select can be noncontiguous and should always include all the rows. Also, you can create variables from noncontiguous data selections. For more information see the New Variable Editor Features in Release 2012aNew Variable Editor Features in Release 2012a demo.

MATLAB Dock Menu on Mac Includes New Capabilities

Previously, on a Mac, the Dock menu associated with the MATLAB icon included only the default options, such as Hide/Show and Quit. Now, consistent with the behavior of most Mac applications, the MATLAB Dock menu lists open windows and documents associated with the running MATLAB application. By choosing on any of the entries in the Dock menu, you can bring that window or document to the front. To view the Dock menu, right-click the MATLAB icon in the Dock or Ctrl+click the icon, if you have a one-button mouse.

In addition, the MATLAB Dock menu includes a new option, named Open Additional Instance of MATLAB, that is a convenient way to start another instance of MATLAB running on your computer.

The following figure shows the MATLAB Dock menu with a document open in the MATLAB Editor.

Improved Rendering in MATLAB Web Browser

The MATLAB Web browser uses a new HTML rendering engine on Microsoft Windows systems. This new engine provides better rendering, particularly on 64-bit systems. This update impacts the display of HTML from these sources:

  • web commands

  • Published MATLAB file output

  • Folder reports from the Current Folder browser

  • Simulink Model Advisor

Technical Support Requests Use Proxy Settings

You can submit Technical Support requests from MATLAB by selecting Help > Submit a MathWorks Support Request. In previous releases, if you were connected to the Internet via a proxy server, you had to save the request form to a text file, and then email it to MathWorks. Starting with R2012a, you can submit the request directly from the form.

Published Code Can Display Syntax Highlighted Sample Code

When you publish MATLAB code, you can have sample code appear with syntax highlighting. Sample code is code that appears within comments. Previously, only uncommented code appeared with syntax highlighting.

Compatibility Considerations

Previously, to publish preformatted text (without syntax highlighting), MATLAB required two or more spaces between the comment character (%) and the first text character in a code cell comment block. Now, to publish such text, there must be two, four, or more spaces in that location. Three spaces results in syntax highlighted sample code.

The publish Function Accepts Name-Value Pairs

You can customize the output from the publish function using Name-Value pair arguments. Previously, to customize the output from this function, you had to use a structure. You now can use either a structure or Name-Value pair arguments. For details, see publish.

Internationalization

Displaying Non-7-Bit ASCII Characters on Mac OS X Platforms

On Apple Mac OS X platforms, you might see garbled text if you try to use non-7-bit ASCII characters. For example, if you create a variable in the MATLAB command window containing these characters, you can type the characters, but if you display the contents of the variable, the characters are corrupted.

Or if you share MATLAB text files with a user on a computer with different locale settings, they might see corrupted text. The characters are rendered in that user's locale, not the language it was written in.

MATLAB text files include scripts and user-defined functions and classes. MATLAB displays characters in a text file using an encoding scheme, which is defined in the MathWorks locale database. This encoding scheme supports characters for the language specified by the user locale setting. If you try to use non-7-bit ASCII characters in a text file, you might have to use a different encoding scheme. UTF-8 is often used to handle multilingual characters. Beginning in R2011b, to handle non-7-bit ASCII characters, you can change the default encoding scheme to UTF-8 by switching the MathWorks locale database. Note that changing the default encoding scheme might cause characters other than 7-bit ASCII characters in existing text files to be garbled.

See How the MATLAB Process Uses Locale Settings for more information.

How to Change MATLAB's Default Encoding to UTF-8

If you have text files containing non-7-bit ASCII characters, you must convert the encoding in the files before changing the default encoding on your computer. For instructions, see How to Convert Text File Encoding to UTF-8.

You can change the default encoding scheme on Mac OS X platforms by using the UTF-8 locale database found in the matlabroot/bin folder.

To change the default locale database, type:

mldir = fullfile(matlabroot,'bin');
copyfile(fullfile(mldir,'lcdata.xml'),...
  fullfile(mldir,'lcdata_default.xml'));
copyfile(fullfile(mldir,'lcdata_utf8.xml'),...
  fullfile(mldir,'lcdata.xml'));

Alternatively, you can change the default locale database by setting an environment variable on your computer.

  1. Set the environment variable, MWLOCALE_LCDATA_FILENAME, with the UTF-8 version of the locale database name, lcdata_utf8.xml, in the environment file, environment.plist. Please see this article from the Mac OS X Developer Library, Technical Q&A QA1067 "Setting environment variables for user processes" at http://developer.apple.com/library/mac/#qa/qa1067/_index.html.

  2. Close MATLAB if it is currently running.

  3. Start MATLAB by double-clicking the MATLAB icon in the Applications folder.

How to Convert Text File Encoding to UTF-8

Before converting a file, copy the file to a new directory.

Use the Mac OS X TextEdit application to convert the file encoding. For example:

  1. Open a MATLAB text file with TextEdit.

  2. Select File -> Save as...

  3. Change the file name.

  4. Change Plain Text Encoding: to Unicode (UTF-8).

  5. Save the file.

Alternatively, the following MATLAB function, convert_file_encoding, creates a new text file with different encoding.

function convert_file_encoding(infile,outfile,from_encoding,to_encoding)
 
if strcmp(infile(end-2:end),'mdl');
    isMDL = 1;
else
    isMDL = 0;
end
 
 
fpIn = fopen(infile,'r','n',from_encoding);
fpOut = fopen(outfile,'w','n',to_encoding);
 
while feof(fpIn) == 0
    lineIn = fgets(fpIn);
    if isMDL && strncmp('SavedCharacterEncoding',strtrim(lineIn),22)
        lineIn = regexprep(lineIn,from_encoding,to_encoding);
    end
 
    fwrite(fpOut,lineIn,'char');
end
 
fclose(fpIn);
fclose(fpOut);
end

To use this function, you need to know the current encoding, from_encoding.

  • For MATLAB R2010b or later:

    ret = feature('locale');
    from_encoding = ret.encoding;
    
  • For MATLAB R2008a through R2010a:

    ret = feature('locale');
    [t,r] = strtok(ret.ctype,'.');
    from_encoding = r(2:end);
    

For example, a file, myFile.m, was created with MATLAB encoding set to ISO-8859-1. To convert the file to UTF-8, type:

convert_file_encoding('myFile.m','myFileUTF8.m','ISO-8859-1','UTF-8')

Compatibility Considerations

In a future release, the UTF-8 version of the MathWorks locale database will be the default on Mac OS X systems. Any text file created in MATLAB that is encoded in the user default encoding and contains characters other than 7-bit ASCII characters must be converted to the UTF-8 encoding scheme. Otherwise, MATLAB and other MathWorks products might not be able to properly load the files.

You must convert the file encoding before changing the default locale database.

Do not convert text files to UTF-8 if you share them with users on Windows platforms.

Mathematics

New Integral Functions

The new functions, integral, integral2, and integral3 perform numerical integration with additional support for nonrectangular and unbounded regions of integration. They are the recommended functions for performing quadrature.

Performance Enhancements

The following functions show improved performance:

  • Arithmetic and similar basic math functions for double, single, and integer data types.

  • The grid-based interpolation functions, interp2, interp3, and interpn.

  • Generating random values using either rng('combRecursive') or RandStream('mrg32k3a').

griddata Supports 3-D Data and Natural Neighbor Interpolation

griddata is now the recommended function for interpolating 2-D and 3-D scattered data. griddata also has a new method option, 'natural', for specifying natural neighbor interpolation.

TriScatteredInterp Accepts Complex Values

You can now use TriScatteredInterp to interpolate complex scattered data in a single pass. For example, F = TriScatteredInterp(X,V) now accepts a complex vector V.

Set Functions Provide Option to Return Sets in Original Order

You now can specify the ordering of the output array returned by the functions unique, union, intersect, setdiff, and setxor. The new argument, setOrder, is one of two strings, 'stable' or 'sorted'. Specify 'stable' if you want the elements in the output array to be in the same order as in the input array. For example:

C = unique([9 2 2],'stable') returns C = [9 2].

Specify 'sorted' if you want the elements in the output array to be in sorted order. For example:

C = unique([9 2 2],'sorted') returns C = [2 9].

Set Functions Changing Behavior in a Future Release

In a future release, the behavior of unique, union, intersect, setdiff, setxor, and ismember will change.

  • If there are repeated elements in the input arrays, the functions unique, union, intersect, setdiff, and setxor will return the index to the first occurrence of the repeated elements (or rows).

  • The optional output array, locb, returned by ismember, will contain the lowest absolute indices in B for elements (or rows) that are also in A.

  • All index vectors returned by unique, union, intersect, setdiff, or setxor will be column vectors.

  • unique and union will support objects with methods sort (sortrows for the 'rows' option), and ne. This includes heterogeneous arrays derived from the same root class.

  • intersect, setdiff, setxor, and ismember will support objects with methods sort (sortrows for the 'rows' option), ne, and eq. This includes heterogeneous arrays derived from the same root class.

  • The input arrays passed to union, intersect, setdiff, setxor, and ismember must be of the same class with the following exceptions:

    • Logical, char, and all numeric classes can combine with double arrays.

    • Cell arrays of strings can combine with char arrays.

Compatibility Considerations

The new behavior change is introduced for adoption in R2012a. If you want to assess the impact this change might have on your existing code, specify 'R2012a' as the final input argument to unique, union, intersect, setdiff, setxor, and ismember. For example:

[C,IA,IC] = unique([9 9 1],'R2012a')
C =

     1     9


IA =

     3
     1


IC =

     2
     2
     1

If the changes adversely affect your code, you can specify 'legacy' to preserve the current behavior. For example:

[C,IA,IC] = unique([9 9 1],'legacy')
C =

     1     9


IA =

     3     2


IC =

     2     2     1

Interpolation and Computational Geometry Functionality Being Removed or Changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations
interp1qStill Runsinterp1Replace all instances of interp1q with interp1.
interp1(..., 'cubic')Still Runsinterp1(..., 'pchip')Replace all instances of interp1(..., 'cubic') with interp1(..., 'pchip').
Passing nonuniformly spaced points or grid to:
interp1(..., 'v5cubic')
interp2(..., 'cubic')
interp3(..., 'cubic') 
interpn(..., 'cubic') 
Warns
interp1(..., 'spline')
interp2(..., 'spline')
interp3(..., 'spline') 
interpn(..., 'spline') 
In previous releases, interp1, interp2, interp3, and interpn silently changed the 'v5cubic' and 'cubic' methods to 'spline' when the sample data was not uniformly spaced. Now, a warning is issued if the uniformity conditions are not honored. To avoid the warning message, change any instances that call for'v5cubic' or 'cubic' to the 'spline' method.
Passing the 'pp' flag to interp1. For example:

pp = interp1(x, v, 'linear', 'pp');
vq = ppval(pp, xq);
Still RunsUse griddedInterpolant to create an interpolating function that is efficient to evaluate in a repeated manner. Replace all instances of interp1(..., 'pp') with griddedInterpolant. For example:

F = griddedInterpolant(x, v, 'linear');
vq = F(xq);
interp1(X, Y, Xq, [], ...) where [] specifies the default interpolation method Still Runsinterp1(X, Y, Xq, 'linear', ...)Replace all instances of interp1(X, Y, Xq, [], ...) with interp1(X, Y, Xq, 'linear', ...).
interp1(x,V,..) where x is a vector and V is an array representing multiple value sets. For example:
x = (1:5)'; 
V = [x, 2*x, 3*x];
xq = (1:0.5:5)';
Vq = interp1(x, V, xq);
Still RunsUse griddedInterpolant and loop over each value set, updating and evaluating during each iteration.Replace all instances of interp1(x,V,...), where x is a vector and V is an array representing multiple value sets. Loop over V, calling griddedInterpolant on each value set. The following example code shows how to set up and interpolate over three value sets in V :

x = (1:5)';
V = [x, 2*x, 3*x];
xq = (1:0.5:5)';
F = griddedInterpolant(x, V(:,1));
for n=1:3
  F.Values = V(:, n);
  Vq(:, n) = F(xq);
end


The columns of Vq are the interpolation results for the corresponding columns of V.
Passing mixed orientation vectors to interp2:

Vq = interp2(x, y, V, xq, yq)

Specifically, if one or both of the following are true:
  • One of x and y is a row vector and the other is a column vector.

  • One of xq and yq is a row vector and the other is a column vector.

Still Runs

Construct the full grid with meshgrid first. Alternatively, use griddedInterpolant if you have a large data set.

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

    [X,Y] = meshgrid(x, y);
    [Xq,Yq] = meshgrid(xq, yq);
    Vq = interp2(X, Y, V, Xq, Yq);

  • Pass the vectors to griddedInterpolant inside a cell array.
    F = griddedInterpolant({x, y}, V.');
    Vq = (F({xq, yq})).'

Passing mixed orientation vectors to interp3:

interp3(x, y, z, V, xq, yq, zq)

Specifically, if one or both of the following are true:
  • x, y, and z are a combination of row and column vectors.

  • xq, yq, and zq are a combination of row and column vectors.

Still Runs

Construct the full grid with meshgrid first. Alternatively, use griddedInterpolant if you have a large data set.

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

    [X,Y,Z] = meshgrid(x, y, z);
    [Xq,Yq,Zq] = meshgrid(xq, yq, zq);
    Vq = interp3(X, Y, Z, V, Xq, Yq, Zq);

  • Pass the vectors to griddedInterpolant inside a cell array.

    V = permute(V, [2 1 3]);
    F = griddedInterpolant({x, y, z}, V);
    Vq = F({xq, yq, zq});
    Vq = permute(Vq, [2 1 3]);

Passing mixed orientation vectors to interpn:

interpn(x1,x2,...,xn, V, x1q,x2q,...,xnq)

Specifically, if one or both of the following are true:
  • x1,x2,...,xn are a combination of row and column vectors.

  • x1q,x2q,...,xnq are a combination of row and column vectors.

Still Runs

Construct the full grid with ndgrid first. Alternatively, use griddedInterpolant if you have a large data set.

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

    [X1,X2,...,Xn]= ndgrid(x1,x2,...,xn);
    [X1q,X2q,...,Xnq]= ndgrid(x1q,x2q,...,xnq);
    Vq= interpn(X1,X2,...,Xn, V, X1q,X2q,...,Xnq);

  • Pass the vectors to griddedInterpolant inside a cell array.

    F= griddedInterpolant({x1, x2,...,xn}, V);
    Vq= F({x1q, x2q,...,xnq});

interp1(..., *METHOD)
interp2(..., *METHOD)
interp3(..., *METHOD) 
interpn(..., *METHOD)

Still Runs

Errors for invalid input data

interp1(..., METHOD)
interp2(..., METHOD)
interp3(..., METHOD) 
interpn(..., METHOD)
In previous releases, interp1,interp2,interp3, and interpn provided a *METHOD option that bypassed error checking on the assumption of valid data. These checks are no longer bypassed. Use the griddedInterpolant class to perform repeated interpolation queries on the same data set without penalty of repeated error checks.
vq= griddata(x,y,v,xq,yq) where xq is a row vector and yq is a column vector.Still Runsvq= griddata(x,y,v,Xq,Yq) where Xq and Yq are the output arrays returned by meshgrid.Modify all instances that pass mixed orientation vectors to griddata. To specify a grid of query points, construct a full grid with meshgrid before calling griddata.
griddata3ErrorsgriddataReplace all existing instances of griddata3 with griddata.
delaunay3ErrorsdelaunayReplace all existing instances of delaunay3 with delaunay.
tsearchErrorsDelaunayTri/pointLocationReplace all existing instances of tsearch with DelaunayTri/pointLocation.
dsearchErrorsDelaunayTri/nearestNeighborReplace all existing instances of dsearch with DelaunayTri/nearestNeighbor.
convhull(..., OPTIONS)ErrorsOmit the OPTIONS argument when you call convhull.Remove the OPTIONS argument from all instances that pass it to convhull.
delaunay(..., OPTIONS)ErrorsOmit the OPTIONS argument when you call delaunay.Remove the OPTIONS argument from all instances that pass it to delaunay.
griddata(..., OPTIONS)ErrorsOmit the OPTIONS argument when you call griddata.Remove the OPTIONS argument from all instances that pass it to griddata.
voronoi(..., OPTIONS)ErrorsOmit the OPTIONS argument when you call voronoi.Remove the OPTIONS argument from all instances that pass it to voronoi.

Other Functionality Being Removed or Changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations
isequalwithequalnansStill RunsisequalnReplace all instances of isequalwithequalnans with isequaln.
mimofrStill RunsNot ApplicableRemove all instances of mimofr from your existing code.
RandnAlg property of RandStream classWarnsNormalTransform property of RandStream classReplace all existing instances of RandnAlg with NormalTransform.
setDefaultStream method of RandStream classWarnssetGlobalStream method of RandStream classReplace all existing instances of RandStream.setDefaultStream with RandStream.setGlobalStream.
getDefaultStream method of RandStream classWarnsgetGlobalStream method of RandStream classReplace all existing instances of RandStream.getDefaultStream with RandStream.getGlobalStream.
atan2(y,x) for complex y and x.Errorsatan2(real(y),real(x)) when y and x are complex.Replace all existing instances of atan2(y,x) with atan2(real(y),real(x)) where y and x are complex.
Second output argument for besselh, besseli, besselj, besselk, bessely, and airy. For example, [J,ierr] = besselj(nu,Z).WarnsSyntax 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)
Warns

Construct the inputs with ndgrid or meshgrid first. 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)WarnsY = 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),[])
WarnsJ = 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 Analysis

Programming

xlsread Reads XLSX Files on All Platforms

The xlsread function now reads data from XLSX files on all platforms, including support for specifying the range and worksheet number. Previously, this functionality was available only on Microsoft Windows systems with Excel software.

VideoWriter Supports MPEG-4 Files on Windows 7 Systems

VideoWriter now creates MPEG-4 files with the extension .mp4 or .m4v on Windows 7 systems. For more information, see the VideoWriter reference page.

audioplayer Supports Overlapping Playback

In R2011a, changes that allowed audioplayer to support device selection also disabled the ability to play overlapping audio samples. With R2012a, overlapping playback is available again.

For example, play a second sample before the first one completes, and hear audio from both:

chirpData = load('chirp.mat');
chirpObj = audioplayer(chirpData.y,chirpData.Fs);

gongData = load('gong.mat');
gongObj = audioplayer(gongData.y,gongData.Fs);

play(chirpObj);
play(gongObj);

importdata Returns Different Output for Some Text Files

Previously, the importdata function recognized comments in text files and did not include them in the output. In addition, importdata parsed files that contained numeric values and comma, space, or tab delimiters into a numeric array, even when you specified a delimiter that did not match the contents of the file.

In this release, importdata honors the specified delimiter, and includes comments in the output. For example, consider a hypothetical file named test.txt with this space-delimited data:

% Comment in file
1 2 3
4 5 6

In previous releases,

t = importdata('test.txt',',')

returned a numeric array:

t =
     1     2     3
     4     5     6

In this release, the same code returns a cell array:

t = 
    '% Comment in file'
    '1 2 3'
    '4 5 6'

If you remove the incorrect comma delimiter,

t = importdata('test.txt')

importdata returns a struct array:

t = 
        data: [2x3 double]
    textdata: {'% Comment in file'}

Exponents Print with Two Digits

In previous releases, functions that printed floating-point values with exponents used three digits for the exponent on Windows systems, but two digits on any other system. Now, these functions use two digits for the exponent on all systems.

For example,

str = sprintf('%e',pi)

always returns

str =
3.141593e+00

Conversion of Error and Warning Message Identifiers

For R2012a, 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:eigs:NonPosIntSize identifier has changed to MATLAB:eigs:RoundNonIntSize. If your code checks for MATLAB:eigs:NonPosIntSize, you must update it to check for MATLAB:eigs:RoundNonIntSize instead. For a mapping of the new identifiers to the original identifiers, see Technical Support solution 1-ERAFNC.

Specify a List of Allowed Subclasses in the Class Definition

You can control which classes are allowed to subclass a class that you define by specifying a list classes in the new class attribute, AllowedSubclasses. See Controlling Allowed Subclasses for more information.

Specify Which Classes Can Access Class Members

You can control access to specific class members (properties, methods, and events) by specifying a list of classes to which you want to grant access to these members. See Controlling Access to Class Members for more information.

Compatibility Considerations

In previous releases, you could assign a value to the following class member access attributes as a value returned by a function:

  • Properties – Access, GetAccess, and SetAccess

  • Methods – Access

  • Events – ListenAccess and NotifyAccess

With this release, you can specify values for these attributes only explicitly as either the appropriate character string or a meta.class object returned by the ? operator, or a cell array of character strings and/or meta.class objects. See Specify Access to Class Members for more information.

Method Declared as Abstract and Private Now Errors

In previously releases, declaring a method as both Abstract and Access = private did not cause an error. With this release, declaring a method both Abstract and private causes an error.

Compatibility Considerations

If any of your class definitions declare a method as both Abstract and private, you need to declare the method either as Abstract, which make the class abstract and requires subclasses to implement the method with the declared syntax, or declare the method Access = private, which means that only methods within the defining class can call the private method.

Declaring a method as both Abstract and private is not supported.

New Capabilities for Writing Image Data to FITS Files

MATLAB now includes a function named fitswrite that you can use to write image data to Flexible Image Transport System (FITS) files. You can also display the metadata for all Header-Data Units (HDUs) in a FITS file using the fitsdisp function. (MATLAB already supports reading FITS files using the fitsread function.)

In addition, MATLAB now includes a new package, called matlab.io.fits, containing dozens of functions that provide access to the routines in the CFITSIO library. Using these low-level functions, you can create FITS files, read data from FITS files and write data to the files, using the CFITSIO library, version 3.27.

Access Data on Remote Servers Using the OPeNDAP Protocol

You can read data stored on remote servers using the OPeNDAP protocol capability of the following MATLAB NetCDF functions:

To use these functions to access data on remote servers using OPeNDAP protocol, specify the URL instead of a file name.

Upgrades to Scientific File Format Libraries

The following table lists upgrades to scientific file format libraries used by MATLAB.

LibraryVersion
NetCDF4.1.3 (upgraded from 4.1.2)

Ability to Read NetCDF Files Using HDF4 Functions Removed

In past releases, for certain NetCDF files on Linux and Macintosh systems, you could read the files using the HDF4 functions. This capability has been removed. To read NetCDF files, use the high-level NetCDF functions or the low-level NetCDF package.

Functionality Being Removed or Changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
avifileStill runsVideoWriterReplace all instances of avifile with VideoWriter.
fileparts return argument 4 (file version)Errors — beginning in MATLAB Version 7.13 (R2011b)No alternative; file versions are unsupportedCall fileparts with three return arguments: [path_name, file_name, file_extension]
helpbrowserStill runsdocReplace all instances of helpbrowser with doc.
helpdeskStill runsdocReplace all instances of helpdesk with doc.
helpwinStill runsdocReplace all instances of helpwin with doc.
infoWarns Remove all instances of info. Find information about MathWorks at www.mathworks.com/company/aboutus/contact_us.
mmreaderWarns, creates a VideoReader objectVideoReaderReplace all instances of mmreader with VideoReader.
mmreader.isPlatformSupported and VideoReader.isPlatformSupportedErrors For a platform-specific list of supported video file formats, use getFileFormats.
supportWarns Remove all instances of support. Find the MathWorks technical support page at www.mathworks.com/support.
whatsnewWarns Remove all instances of whatsnew.

Graphics and 3–D Visualization

Creating Graphical User Interfaces (GUIs)

External Interfaces/API

Changes to Compiler Support

New Compiler Support

MATLAB Version 7.14 (R2012a) supports these new compilers for building MEX-files on Linux 64- and 32-bit platforms:

  • GNU gcc Version 4.4.6

MATLAB supports these new compilers for building MEX-files on Windows 64- and 32-bit platforms:

  • Intel Visual Fortran Composer XE 2011 SP1 (12.1)

Discontinued Compiler Support

MATLAB no longer supports the following compilers:

Windows 64-Bit Platforms

  • Microsoft Visual Studio® 2010 (10.0) Express

Windows 32-Bit Platforms

  • Microsoft Visual Studio 2010 (10.0) Express

  • Visual C++ 6.0

Linux (64- and 32-Bit) Platforms

  • GNU gcc Version 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 the Supported and Compatible Compilers Web page.

mxAssert and mxAssertS Functions Throw MATLAB Exception

The mxAssert and mxAssertS functions now throw the MATLAB exception MATLAB:mex:assertion and terminate the MEX-file instead of aborting MATLAB.

Version Support for COM ProgID Values

You can specify version-specific Programmatic Identifiers (ProgID) for MATLAB Version 7.14 (R2012a) and later.

  • MATLAB.Desktop.Application

  • MATLAB.Application

  • MATLAB.Application.Single, to specify a dedicated server.

R2011b

New Features, Bug Fixes, Compatibility Considerations

Desktop Tools and Development Environment

Command Window

Error Messages Reformatted for Improved Readability and Navigation

Error messages in the Command Window no longer appear with question marks or arrows. In addition, error messages for each function now provide a link to that function's documentation.

The following images show examples of the differences in presentation:

  • Built-in functions:

    • MATLAB Version 7.13 (R2011b)

    • MATLAB Version 7.12 (R2011a) and earlier

  • Functions that are not built in:

    • MATLAB Version 7.13 (R2011b)

    • MATLAB Version 7.12 (R2011a) and earlier

Editor

New Desktop features and changes introduced in this version are:

Automatically Renaming All Variables and Functions in File

Under certain conditions, as you rename a variable or function, a tooltip opens. The tooltip indicates that MATLAB can rename all instances of the function or variable in the current file. This is helpful in preventing errors that result if you change names manually and overlook or mistype one or more instances of the name. For a video overview, watch this video demovideo demo

For details, including the circumstances under which MATLAB prompts you, see Automatically Rename All Functions or Variables in a File.

Internationalization

Displaying Multilingual Characters on Mac OS X Platforms

On Apple Mac OS X platforms, you might see garbled text if you try to use multilingual characters. Suppose you create a variable in the MATLAB command window containing multilingual characters. You can type the multilingual characters, but if you display the contents of the variable, the characters are corrupted.

MATLAB text files include scripts and user-defined functions and classes. MATLAB displays characters in a text file using an encoding scheme, which is defined in the MathWorks locale database. This encoding scheme supports characters for the language specified by the user locale setting. If you try to use multilingual characters in a text file, you may have to use a different encoding scheme. UTF-8 is often used to handle multilingual characters. In R2011b, to handle multilingual characters, you can change the default encoding scheme to UTF-8 by switching the MathWorks locale database. Note that changing the default encoding scheme might cause characters other than 7-bit ASCII characters in existing text files to be garbled.

See How the MATLAB Process Uses Locale Settings for more information.

How to Change MATLAB's Default Encoding to UTF-8

You can change the default encoding scheme on Mac OS X platforms by using the UTF-8 locale database found in the matlabroot/bin folder. If you have text files containing characters other than 7-bit ASCII characters, you must convert the encoding before changing the default encoding. For instructions, see How to Convert Text File Encoding to UTF-8.

To change the default locale database, type:

mldir = fullfile(matlabroot,'bin');
copyfile(fullfile(mldir,'lcdata.xml'),...
  fullfile(mldir,'lcdata_default.xml'));
copyfile(fullfile(mldir,'lcdata_utf8.xml'),...
  fullfile(mldir,'lcdata.xml'));

How to Convert Text File Encoding to UTF-8

Before converting a file, copy the file to a new directory.

Use the Mac OS X TextEdit application to convert the file encoding. For example:

  1. Open a MATLAB text file with TextEdit.

  2. Select File ->Save as...

  3. Change the file name.

  4. Change Plain Text Encoding: to Unicode (UTF-8).

  5. Save the file.

Alternatively, the following MATLAB code creates a new text file with the encoding set to UTF-8:

function convertencoding(infile, outfile)

fpIn = fopen(infile, 'r', 'n');
fpOut = fopen(outfile, 'w', 'n', 'UTF-8');

while feof(fpIn) == 0
  lineIn = fgets(fpIn);
  fwrite(fpOut, lineIn, 'char');
end

fclose(fpIn);
fclose(fpOut);
end

Compatibility Considerations

In a future release, the UTF-8 version of the MathWorks locale database will be the default on Mac OS X systems. Any text file created in MATLAB that is encoded in the user default encoding and contains characters other than 7-bit ASCII characters must be converted to the UTF-8 encoding scheme. Otherwise, MATLAB and other MathWorks products might not be able to properly load the files.

You must convert the file encoding before changing the default locale database.

Mathematics

New Functionality for Grid-Based Interpolation

MATLAB includes a new class, griddedInterpolant, for grid-based interpolation. griddedInterpolant works with grids in ndgrid format and complements the functionality provided by interpn to provide improved performance and memory efficiency.

Performance Enhancements

The following functions show improved performance:

  • Some integer math functions

  • Some linear algebra functions, including chol and 3-output form of qr

  • Trigonometric functions

Permutation Option for randperm

The randperm function and the RandStream.randperm method now have the option of returning random permutations of k integers selected at random from the integers 1 through n.

Return Permutation Information in Vector for qr

If you use the three-output form of qr in noneconomy mode, you can now specify 'vector' as an input argument. The permutation information will return a vector instead of a matrix.

Changes to meshgrid and ndgrid

The functions meshgrid and ndgrid have changed behavior under certain calling scenarios:

  • When more than one input argument is passed to meshgrid, the dimensionality of the output arrays is deduced from the number of inputs.  Previously the dimensionality was deduced from the number of outputs.  For example, [x,y] = meshgrid(1:3,1:4,1:5) will now assume a missing third output argument and return 3-D output arrays x and y. Previously, the third input was ignored and the function returned 2-D arrays for x and y.

  • When a single argument is passed to ndgrid, the dimensionality of the output arrays is dictated by the number of output arguments. ndgrid has been revised to maintain consistency in the case of a single input and output. ndgrid will now degenerate naturally to support 1-D outputs. For example, x = ndgrid(1:5) returns a 5-by-1 output vector x. Previously, a 5-by-5 array was returned.

Functionality Being Removed or Changed

FunctionalityWhat Happens When You Use This FunctionalityUse This InsteadCompatibility Considerations
besselErrorsbesseljReplace all instances of bessel with besselj.
ODE solver syntax
solver('vdp',t0,tfinal,y0)
where solver is one of the ODE solvers ode45, ode23, ode113, ode15s, ode23s, ode23t, or ode23tb
Errorssolver('vdp',[t0 tfinal],y0)
or
solver(@vdp,[t0 tfinal],y0)
Replace all instances of the syntax t0,tfinal with [t0 tfinal].
Values on and off for Mass property of odeset and odegetErrorsSet the Mass property to a constant matrix or a function that evaluates the variable mass matrix.Update your code to use a constant mass matrix or a function that evaluates the variable mass matrix. For more information, check the supported settings of Mass and MassStateDependency in the odeset properties.
MassConstant property of odeset and odegetErrorsFor a constant mass matrix, set the Mass property to that matrix. For a time-dependent mass matrix, set the Mass property to a function that evaluates the matrix and set the MassStateDependency property to none.Update your code to use a constant mass matrix or a function that evaluates the variable mass matrix. For more information, check the supported settings of Mass and MassStateDependency in the odeset properties.

Data Analysis

Programming

Load and Save Parts of Variables in V7.3 MAT-Files

The new matfile function creates a matlab.io.MatFile object that can efficiently load or save to parts of variables in Version 7.3 MAT-Files. Loading part of a variable requires less memory than loading the entire contents of that variable.

For example, these commands create a MAT-file and add data to part of variable X:

new = matfile('newfile.mat','Writable',true);
new.X(6:10,6:10) = magic(5); 

This command loads part of the data into variable partOfX:

partOfX = new.X(1:8,1:8);

    Note:   Syntax such as size(new.X) or new.X(end,end) temporarily loads the entire contents of variable X into memory. To determine the size of a variable without loading, use the size method for matlab.io.MatFile objects:

    sizeOfX = size(new,'X');
    

For more information, see the matfile reference page or watch this video demovideo demo.

Nonmatching Function Name Warning is Now an Error

In previous releases of MATLAB, entering a function name that did not match any known function name in the given letter case resulted in a warning. After displaying this warning message, MATLAB attempted find a function that would match if letter case were ignored. If such a match were found, MATLAB ran this function instead.

In MATLAB R2011b, the MATLAB software generates an error if it can't find an exact-case match. The message displayed by the error may suggest the correct spelling for the function that was entered. The message identifier for this error reads as follows:

'MATLAB:dispatcher:InexactCaseMatch'

Compatibility Considerations

If you have a program that calls another program with nonmatching letter case, the call to this function now throws an error.

New narginchk Function Replaces nargchk

narginchk is a new function that replaces and adds to the functionality of nargchk.

The narginchk function differs from nargchk in the following ways:

  • narginchk accepts only 2 inputs: the minimum and maximum allowable number of arguments one can pass to the currently running function.

  • narginchk returns no outputs. Instead, it throws an error if the number of arguments passed to the current function is outside the allowable range

Conversion of Error and Warning Message Identifiers

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

Compatibility Considerations

If you have code that uses 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:eigs:NonPosIntSize identifier has changed to MATLAB:eigs:RoundNonIntSize. If your code checks for MATLAB:eigs:NonPosIntSize, you must update it to check for MATLAB:eigs:RoundNonIntSize instead. For a mapping of the new identifiers to the original identifiers, see Technical Support solution 1-ERAFNC.

New Spreadsheet Import Tool

The new Spreadsheet Import Tool allows you to select ranges of data and define rules for handling nonnumeric values. This tool opens instead of the Import Wizard for spreadsheets and comma-separated value (CSV) files. For more information, watch this video demovideo demo.

Two Functions Added to netCDF Low-Level Package To Aid Performance

The NetCDF low-level package now includes two functions that you can use to improve performance:

  • netcdf.getChunkCache – Return default chunk cache settings.

  • netcdf.setChunkCache – Set the default chunk cache settings.

Improved Performance for TIFF Input and Output

Input and output performance for TIFF files has been improved, when using imread and imwrite.

Upgrades to Scientific File Format Libraries

The following table lists upgrades to scientific file format libraries used by MATLAB.

LibraryVersion Upgrade
NetCDF4.0.1 to 4.1.2
HDF51.8.3 to 1.8.6
HDF44.2r4 to 4.2.5
HDF-EOS2.16 to 2.17
TIFF3.7.1 to 3.9.5

VideoReader Supports MPEG-4 and MOV on Windows 7 Systems

VideoReader now imports MPEG-4 and Apple QuickTime movies, and any other formats supported by Microsoft Media Foundation, on Windows 7 systems. For more information, see the VideoReader reference page.

MATLAB Warns if Listener Defined for Nonobservable Property

If you attempt to create a PreSet or PostSet listener for a property that is not declared as SetObservable, MATLAB issues a MATLAB:class:nonSetObservableProp warning.

If you attempt to create a PreGet or PostGet listener for a property that is not declared as GetObservable, MATLAB issues a MATLAB:class:nonGetObservableProp warning.

In previous releases, MATLAB did not warn in either case, but did not call the listener callback function when a set or get event occurred. In a future release, these warnings will become errors.

Compatibility Considerations

If you use class metadata or the properties function to get a list of properties for which you create listeners, add warning/error handling for these conditions. A better approach is to use findobj to get the list of observable properties for any given class and assign listeners only for those properties.

MATLAB Warns if Property Is Not Member of Class When Defining Listener

When calling the event.proplistener constructor, or calling the addlistener method with an array of meta.property objects, warning messages alert you if a property is not a member of the correct class.

  • Nonscalar input objects: if any one of the properties is not a valid member of the class of the object array, MATLAB issues the MATLAB:class:PropNotMember warning .

  • Scalar input object: if any of the properties are not valid dynamic or class properties, MATLAB issues the MATLAB:class:DynPropNotMember or MATLAB:class:PropNotMember warning.

In previous releases, MATLAB did not warn in either case. In a future release, these warnings will become errors.

Built-In disp Works with Empty Objects

It is now possible to call the built-in disp function with empty objects. For example, define the TestClass as:

classdef TestClass
   properties
      PropertyA = 1;
   end
end

Then call the built-in version of disp:

>> builtin('disp',TestClass.empty)
  0x0 empty TestClass

  Properties:
    PropertyA

  Methods

In previous releases, calling the built-in disp function did not display anything with empty objects.

MATLAB Warns if Class Defines Property as Dependent and Constant

MATLAB now issues a warning if a class defines properties as both Dependent and Constant. In a future release, this warning will become an error.

Support for Switch/Case Statements with Objects

You can construct switch statement blocks using objects as both the switch expression and the case expression. The object's class must define or inherit an eq (==) method. See Using Switch/Case Statements with Objects in Functions Used with Objects for more information.

Functionality Being Removed or Changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
nargchkStill runsnarginchkAccepts only min and max inputs, returns no output, generates error.
nargoutchkStill runsnargoutchk (see new syntax)Accepts only min and max inputs, returns no output, generates error.

Graphics and 3-D Visualization

Creating Graphical User Interfaces (GUIs)

External Interfaces/API

Changes to Compiler Support

New Compiler Support

MATLAB Version 7.13 (R2011b) supports these new compilers for building MEX-files on Windows 64- and 32-bit platforms:

  • Microsoft Windows Software Development Kit for Windows 7 and .NET Framework 4, Version 7.1

  • Intel C++ Composer XE 2011

  • Intel Visual Fortran Composer XE 2011

MATLAB Version 7.13 (R2011b) supports the following new compiler for building MEX-files on Mac OS X 64-bit platforms:

  • Apple Xcode 4.0.0 with gcc 4.2.x

Compiler Support To Be Phased Out

Support for the following compilers on Windows 64- and 32-bit platforms 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.

  • Intel C++ Version 11.1

  • Intel Fortran Version 11.1

New Object Support for mxGetProperty and mxSetProperty Functions

You can read and modify properties of Java and COM objects using the mxGetProperty and mxSetProperty functions.

MEX Header File Does Not Define C++ Type char16_t

The matrix.h header file, used by the mex.h header file for building C/C++ MEX-files, no longer defines the C++ type char16_t.

Compatibility Considerations

If your MEX-file uses the char16_t type, you must include the appropriate header file for your compiler in order to build the MEX-file. For example, the header file for Microsoft Visual Studio Version 10.0 is yvals.h.

New Support for Features in Microsoft .NET Framework

Support for Cell Arrays

Creating Cell Arrays from .NET Stings and Objects

Use the MATLAB cell function to convert .NET System.String and System.Object arrays to MATLAB cell arrays. For more information, see Converting .NET Arrays to Cell Arrays.

Passing Cell Arrays to .NET Methods

If an input argument to a .NET property or method is an array of System.Object or System.String, you can pass a cell array. MATLAB automatically converts a cell array into the appropriate .NET array. For more information, see Pass Cell Arrays.

Support for Auto-Conversion of Multidimensional Arrays

You can pass MATLAB arrays directly to .NET without explicitly converting them into .NET arrays. MATLAB also converts an array of a lower dimensionality to a higher dimensionality .NET array. For more information, see Pass Arrays.

Compatibility Considerations

In most cases, you no longer need to use the NET.convertArray function. Review your MATLAB code to update the use of this function. If you continue to use NET.convertArray, note the following change of behavior for empty matrices:

  • If you call NET.convertArray with an N-D empty matrix and try to convert it to 1-D .NET array, MATLAB throws the following error:

    Source and destination array dimension sizes do not match.
  • Different results for:

    NET.convertArray(rand(0,1,1))

    As of R2011a, MATLAB creates a System.Double[,]. In R2011b, MATLAB creates a System.Double[].

COM Automation Server Error Message Formatting

Although some MATLAB Command Window messages have been reformatted (see Error Messages Reformatted for Improved Readability and Navigation), error messages from the Execute function can still be identified with leading ??? characters.


View release notes for older releases

Compatibility Summary

ReleaseFeatures or Changes with Compatibility Considerations
R2014b
R2014a
R2013b
R2013a
R2012b
R2012a
R2011b
Was this topic helpful?