Modify output figures interactively using the tools in the upper right corner of each axes. These tools appear when you select or hover over the axes. For more information, see Modify Output Figures.
You can build an equation interactively in live scripts by selecting
from a graphical display of symbols and structures. To insert a new
equation, go to the Live Editor tab and in the Insert section,
click
Equation.
For more information, see Insert Equations into Live Scripts.
For quick formatting in live scripts, you can use a combination of keyboard shortcuts and character sequences. For more information, including a list of supported sequences, see Autoformatting.
Prevent typographical errors by automatically renaming multiple references to a function or variable within a live script. When you rename such a function or variable, a tooltip opens if there is more than one reference to that variable or function in the file. Press Shift + Enter to rename all instances of the function or variable.
Drag selected code from a live script to and from another application, maintaining syntax highlighting and font characteristics.
The Live Editor now displays output in live scripts as it is created, instead of when the execution of a section is complete.
When displaying output, the Command Window now adds a header that includes the class, size, and shape of a variable. For example:
A = rand(4, 6, 'single')
A = 4×6 single matrix 0.8147 0.6324 0.9575 0.9572 0.4218 0.6557 0.9058 0.0975 0.9649 0.4854 0.9157 0.0357 0.1270 0.2785 0.1576 0.8003 0.7922 0.8491 0.9134 0.5469 0.9706 0.1419 0.9595 0.9340
double
and char
,
including:single | int8 | uint8 | function_handle |
logical | int16 | uint16 | string |
struct | int32 | uint32 | |
cell | int64 | uint64 |
The Command Window also displays array dimensions using a standardized format and an improved layout for integer arrays.
Download and install MathWorks® product trials
directly from MATLAB® using the Add-On Explorer. To open the Add-On
Explorer, go to the Home tab and click the Add-Ons
icon.
info.xml
and helptoc.xml
templates for custom documentation, and modify Java class path on installationWhen you package a toolbox, MATLAB detects live script examples. Then, when someone installs your toolbox, the examples appear in the MATLAB Help browser.
Integrating your toolbox documentation into the MATLAB Help
browser is easier with automatically generated template files. To
display your toolbox documentation under Supplemental Software in
the Help browser, edit the info.xml
and helptoc.xml
template
files.
MATLAB automatically detects JAR files to include on the dynamic path, and you can manage these files in the Package a Toolbox dialog box.
For more information, see Create and Share Toolboxes.
MATLAB now saves preferences to your user Application Support
folder on Mac OS X systems. The location of the user Application
Support folder is ~/Library/Application Support
.
Browse examples across MathWorks products or search for examples using the search box and search filters. To access examples online, go to http://www.mathworks.com/help/examples.html. To access examples in MATLAB, go to the Home tab and click Help > Examples.
Click the Open Script or Open
Live Script button in an example to open it in MATLAB. MATLAB copies
the example file and all dependent files to the folder
,
where userpath
/Examples/examplefilename
examplefilename
is the name of the
example file. The userpath
is the path
returned by the userpath
command. MATLAB then
changes the current folder to the new folder. You can run the example
as is or edit it before running.
MATLAB scripts, including live scripts, can contain code to define local functions. Local functions in scripts are useful for experimenting with code within a single file, as well as writing reusable code that can easily be added, modified, and deleted. For more information, see Add Functions to Scripts.
Note:
If your script contains local functions, you cannot run code
sections (also known as code cells) individually. The
|
string
Array: Manipulate, compare, and store text data efficientlystring
arrays provide
storage of text data and a set of functions for manipulating text.
For example, functions such as contains
find
text in strings. The split
and join
functions
split and join strings in string arrays. You can compare strings with
relational operators such as ==
, and sort them
with the sort
function.
For more information, see Characters and Strings.
timetable
Data Container: Manage time-stamped tabular data with time-based indexing and synchronizationThe timetable
data container is a table that
associates a time with each row. Like the table
container,
the timetable
data container stores column-oriented
data variables that have different data types and sizes, as long as
the data variables have the same number of rows. To create timetables
from workspace variables or from tables, use the timetable
or table2timetable
functions.
You can resample or aggregate data in timetables with the retime
and synchronize
functions.
You also can use any table function with timetables.
For more information, see Timetables.
timerange
Function: Access all data in a specified date and time range in a timetable
You can create a subscripting variable with the timerange
function and use that variable
to subscript into a timetable
data container.
vartype
Function: Access all variables of a specified datatype in a tableYou can access all table variables of a specified data type
with the vartype
function.
For example, if T
is a table, then S =
vartype('numeric'); Tnum = T(:,S)
returns Tnum
as
a table that contains only the numeric variables from T
.
table
Data Container: Reference all variables in a table with compatible types using the Variables
propertyYou can access all table or timetable variables with compatible
types using the Variables
property. For example,
if T
is a 5-by-2 table with two numeric variables,
then T.Variables
returns a 5-by-2 numeric matrix. T.Variables
is
equivalent to the T{:,:}
syntax.
dir
Function: Search for folders and subfolders recursivelySearch through folders and subfolders on the path recursively
using wildcards in the path name. For more information, see dir
.
Note:
The |
When you add a folder to the MATLAB search path using a relative path, MATLAB now adds the absolute path of the folder to the search path. In previous versions of MATLAB, MATLAB added the relative path of the folder, and the path was re-resolved after every change to the current folder.
If your MATLAB search path contains relative paths to folders,
and you rely on the automatic re-resolving of the paths when changing
folders, you must update your search path. Use the Set Path dialog
box or the addpath
or path
functions to add the absolute path
of folders to the search path. For more information, see Change Folders on the Search Path.
MATLABPATH
environment variable on WindowsMATLAB now adds the folders specified by the MATLABPATH
environment
variable to the MATLAB search path on Windows® platforms.
This action was previously only done on UNIX® platforms. For more
information, see Set the MATLABPATH Environment Variable.
userpath
Function: Update code to use simplified userpath
on UNIX As of R2016b, the userpath
function
now only returns the first folder on the search path. In previous
versions of MATLAB, userpath
returned
the first folder on the search path, appended with the folders listed
in the MATLABPATH
environment variable for UNIX platforms.
If you have scripts or functions that rely on the userpath
function to return both the
first folder on the search path and the paths listed in the MATLABPATH
environment
variable, then you must update your code. Use the userpath
function to receive only the userpath
folder,
or use the path
function to
receive the full MATLAB search path.
regexp
and regexpi
Functions: Force output arguments into a cell arrayYou can specify the 'forceCellOutput'
argument
to force the regexp
and regexpi
functions to return output arguments
in a cell array. For example, regexp(str,expression)
returns
the indices of matches as a numeric array when str
is
a character vector or a string scalar, but regexp(str,expression,'forceCellOutput')
returns
the same numeric array within a cell.
regexptranslate
Function: Replace matching patterns with escaped regular expressionYou can specify the 'flexible'
argument when
calling regexptranslate
to
replace matching patterns in text with an escaped regular expression
that you specify. The syntax regexptranslate('flexible',str,expression)
replaces
the same text as regexprep(str,expression,regexptranslate('escape',expression))
.
As of R2016b, private functions are visible only to other functions
or scripts that are in the folder immediately above the private
subfolder
(the parent folder). In previous versions of MATLAB, private
functions were visible to scripts outside the parent folder if they
were called by functions inside the parent folder.
If you have a function that calls a script outside the parent folder and that script calls a private function, your code might result in an error or change of behavior. If both the function that calls the script and the script that calls the private function are inside the parent folder, then there is no change in behavior.
If the function that calls the script and the script that calls the private function are in different folders:
A change in behavior might occur if the script finds a different function with the same name as the private function.
An error occurs if the script doesn't find any function with a name that matches the private function name.
Place scripts that need access to private functions to the folder
immediately above the private
subfolder.
The error message identifier MATLAB:datatypes:valueOutsideValidRange
has
changed.
If you have scripts or functions that use the MATLAB:datatypes:valueOutsideValidRange
error
message identifier, you must update the code to use one or more of
the new identifiers listed here. Typically, you might use error message
identifiers in code that uses a try/catch statement and performs an
action based on a specific error identifier.
MATLAB:datatypes:OutsideRangeFiniteGreater0
MATLAB:datatypes:OutsideRangeIntegerGreater0
MATLAB:datatypes:OutsideRangeNaN0to1
MATLAB:datatypes:OutsideRangeValidNumber
MATLAB:datatypes:OutsideRange0to1
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
Calling | Errors | Move calls to | If you call |
Visibility of local functions | Errors | Store the function handle to the local function in a
variable and use that instead of the call to the local function. For
example, assign | Local functions are visible only to other functions in the same file. Previously, if a function file that defines local functions invoked a script, that script could call those local functions. |
Scripts that call private functions, but do not reside
in the folder immediately above the | Errors | Store the function handle to the private function in
a variable and use that instead of the call to the private function.
For example, assign | Private functions are visible only to other functions
or scripts in the folder immediately above the |
Linear indexing to expand | Errors | To use linear indexing to expand a multidimensional | Previously, linear indexing to expand the bounds of |
Deletion of table rows or variables by subscripting into
table and assigning empty quotation marks ( | Errors | To delete table rows or variables, subscript into the
table row or variable, and assign empty square brackets ( | Previously, an assignment using empty quotation marks when subscripting into a table would delete table rows or variables. |
Deletion of | Errors | To delete | Previously, an assignment using empty quotation marks
when subscripting into a |
Deletion of | Still runs | To delete | An assignment using empty quotation marks when subscripting
into a |
Deletion of | Still runs | To delete | An assignment using empty quotation marks when subscripting
into a |
Implicit expansion is a generalization of scalar expansion. With scalar expansion, a scalar expands to be the same size as another array to facilitate element-wise operations. With implicit expansion, the element-wise operators and functions listed here can implicitly expand their inputs to be the same size, as long as the arrays have compatible sizes. Two arrays have compatible sizes if, for every dimension, the dimension sizes of the inputs are either the same or one of them is 1. See Compatible Array Sizes for Basic Operations and Array vs. Matrix Operations for more information.
Element-wise arithmetic operators — +
, -
, .*
, .^
, ./
, .\
Relational operators — <
, <=
, >
, >=
, ==
, ~=
Logical operators — &
, |
, xor
Bit-wise functions — bitand
, bitor
, bitxor
Elementary math functions — max
, min
, mod
, rem
, hypot
, atan2
, atan2d
For example, you can calculate the mean of each column in a
matrix A
, and then subtract the vector of mean
values from each column with A - mean(A)
.
Previously, this functionality was available via the bsxfun
function. It is now recommended
that you replace most uses of bsxfun
with direct
calls to the functions and operators that support implicit expansion.
Compared to using bsxfun
, implicit expansion
offers faster speed, better memory usage, and improved readability
of code.
graph
and digraph
Objects: Compute graph isomorphism, biconnected components, cut vertices, and
node condensationisomorphism
—
Compute graph isomorphism equivalence relation between two graphs.
isisomorphic
—
Determine if two graphs are isomorphic.
Graph objects created using graph
support
these functions:
biconncomp
—
Compute biconnected components of undirected graph.
bctree
—
Compute block-cut tree of undirected graph.
Graph objects created using digraph
support
these functions:
condensation
—
Represent each strongly connected component in a directed graph using
a single node.
graph
and digraph
Objects: Visualize graphs and networks in 3-DThe GraphPlot
object returned by plotting
a graph
or digraph
now contains
a ZData
property. If ZData
is
nonempty, then it specifies z-coordinates for the
graph nodes.
Additionally, new layout methods are available for 'force3'
and 'subspace3'
,
which automatically calculate values for XData
, YData
,
and ZData
to display the graph in three dimensions.
digraph
Object: Reverse edge directions in a directed graph using the flipedge
functionThe flipedge
function
reverses the direction of directed edges in a graph.
conv2
Function: Compute 2-D convolutions with improved performanceThe conv2
function performs
faster when using the syntax conv2(u,v,A)
, where u
and v
are
vectors and A
is a matrix.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
circshift behavior change for row vectors | Still runs | To preserve previous behavior when operating on row vectors
with a scalar shift factor, specify 1 for the dimension argument.
For example, use circshift([1 2 3 4],2,1) , where
2 is the shift factor and 1 is the dimension. | circshift now shifts elements along row
vectors when provided a scalar shift factor. For example, circshift([1
2 3 4],2) returns the vector [3 4 1 2] .
Previously, circshift returned the original row
vector with no shifting. |
To plot datetime or duration data, you can use these functions.
bar | barh |
plot | plot3 |
semilogx (x values
must be numeric) | semilogy (y values
must be numeric) |
stem | stairs |
area | mesh |
surf | surface |
fill | fill3 |
line | text |
Also, you can use the new datetime and duration ruler objects to customize the axes. Access the datetime or duration ruler object through the axes object. For example:
d = duration(1,30:33,0); y = [3 5 2 3]; plot(d,y) ax = gca; ax.XAxis
ans = DurationRuler with properties: Limits: [01:29:55 01:33:04] TickValues: [01:30:00 01:30:30 01:31:00 01:31:30 01:32:00 01:32:29 01:33:00] TickLabelFormat: 'hh:mm:ss' Show all properties
For a list of object properties, see Datetime Ruler Properties and Duration Ruler Properties.
When plotting datetime or duration data, consider these changes:
The xlim
, ylim
, zlim
,
and axis
functions no longer accept double values
to set the limits for an axis with datetime or duration values.
The axis
function no longer supports
setting the axis limits for axes with mixed data types (numeric, datetime,
or duration). Use the xlim
, ylim
,
and zlim
functions instead.
The XLim
, YLim
, ZLim
, XTick
, YTick
,
and ZTick
properties of the axes object now contain
datetime or duration values instead of double values. To change the
limits or tick values, specify datetime or duration values instead
of double values.
The XData
, YData
,
and ZData
properties now contain datetime or duration
values instead of double values. To change the data values, specify
datetime or duration values instead of double values.
Combining plots that mix different data types along a single axis results in an error. When combining plots, use only one data type per axis.
polarscatter
and polarhistogram
Functions: Create scatter and histogram plots in polar coordinatesTo create scatter plots in polar coordinates, use the polarscatter
function. Similarly, you
can create histograms in polar coordinates using the polarhistogram
function. The polarhistogram
function
supersedes the rose
function.
fimplicit
and fimplicit3
Functions: Plot implicit functions of the form f(x,y)
= 0 and f(x,y,z)
= 0To plot implicit functions of the form f(x,y)
= 0, use the fimplicit
function.
To plot implicit functions of the form f(x,y,z)
= 0, use the fimplicit3
function.
You can customize the appearance of the tick values and labels along each axis using tick formatting functions. Use the x-axis, y-axis, and z-axis versions when plotting in Cartesian coordinates. Use the r-axis and theta-axis versions when plotting in polar coordinates.
This table lists the new functions.
Functions | Description |
---|---|
xticks yticks zticks rticks thetaticks | Customize the locations of the tick marks along each axis. |
xticklabels yticklabels zticklabels rticklabels thetaticklabels | Customize the tick labels along each axis. |
xtickformat ytickformat ztickformat rtickformat thetatickformat | Format the tick labels along each axis, such as controlling the number of decimal values shown or displaying the values as currency values. |
xtickangle ytickangle ztickangle rtickangle | Rotate the tick labels along each axis. |
errorbar
Function: Create vertical and horizontal error bars and control hat width To plot both vertical and horizontal error bars, use the errorbar
function. Also, you can control
the width of the caps at each end of the error bars by setting the CapSize
property
of the errorbar object.
x = 1:10;
y = sin(x);
err = std(y)*ones(size(x));
e = errorbar(x,y,err,'horizontal')
e.CapSize = 10;
These new errorbar object properties control the lengths of the error bars in each direction:
XNegativeDelta
and XNegativeDeltaSource
—
Length of left side of horizontal error bars
XPositiveDelta
and XPositiveDeltaSource
—
Length of right side of horizontal error bars
YNegativeDelta
and YNegativeDeltaSource
—
Length of lower portions of vertical error bars
YPositiveDelta
and YPositiveDeltaSource
—
Length of upper portions of vertical error bars
These errorbar object properties still run, but have been replaced with new properties.
Replaced Property | Use This Property Instead |
---|---|
LData | YNegativeDelta |
UData | YPositiveDelta |
LDataSource | YNegativeDeltaSource |
UDataSource | YPositiveDeltaSource |
plot
Function: Control location and frequency of markers with the MarkerIndices
propertyTo control the data points at which markers display, use the MarkerIndices
property
of lines. For example, this code displays a marker every 10 data points.
x = linspace(0,10,500); y = sin(x); plot(x,y,'-o','MarkerIndices',1:10:length(y))
histogram
and histogram2
Functions: Create a histogram from precomputed bin countsPlot histograms using histogram
and histogram2
by directly passing in the
bin counts. When you use this method, histogram
and histogram2
do
not do any data binning.
Commands that require computing the contour matrix now perform faster, such as:
Returning the contour matrix as an output argument
from the contour
or contourf
functions
Querying the value of the ContourMatrix
property
of a contour object
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Still runs | Not applicable | The behavior of |
| Still runs | Not applicable | If axes exist and contain no graphics objects, then |
| Still runs | polarhistogram function | Replace all instances of the rose function
with the polarhistogram function. |
| Errors | Not applicable | When specifying limits for an axis with datetime or duration
values, the xlim , ylim , zlim ,
and axis functions no longer accept double values.
Specify datetime or duration values instead. |
axis function — Setting limits with
different data types | Errors | xlim , ylim , and zlim functions | Setting limits of different data types using the axis function
results in an error. Use the xlim , ylim ,
and zlim functions instead. |
| Errors | Not applicable | When specifying tick values or limits for an axis with datetime
or duration values, the XTick , YTick , ZTick , XLim , YLim ,
and ZLim properties of the axes object no longer
accept double values. Specify datetime or duration values instead. |
XData , YData , and ZData properties
of graphics objects | Still runs | Not applicable | When plotting datetime or duration data, the |
Combining multiple plots that mix different data types (numeric, datetime, or duration data) along a single axis | Errors | One data type per axis | When combining plots, use only one data type per axis. |
| Still runs |
| Replace instances of LData with YNegativeDelta . |
| Still runs |
| Replace instances of LDataSource with YNegativeDeltaSource . |
| Still runs |
| Replace instances of UData with YPositiveDelta . |
| Still runs |
| Replace instances of UDataSource with YPositiveDeltaSource . |
Default value of | Still runs | New default value of 'polaraxes' | The Type property for polar axes objects
now has a default value of 'polaraxes' . In previous
releases the value was 'axes' . Update code to use
the new value. |
Default value of | Still runs | Not applicable | The AlignVertexCenters property for errorbar
objects now has a default value of 'on' . In previous
releases the value was 'off' . Update code to use
the new value. |
readtable
Function: Automatically detect and return date and time data in text and spreadsheet files detectImportOptions
Function: Detect layout of text and Excel files and customize import options to readtable
You can control and customize how data is imported from text
and spreadsheet files using the detectImportOptions
function.
The detectImportOptions
function returns
a SpreadsheetImportOptions
object
for spreadsheet files and a DelimitedTextImportOptions
object for text files.
Use these objects with readtable
to
customize import options, such as:
Import bad or missing data.
Import only a subset of data using the SelectedVariableNames
property.
Customize the decimal separator and thousands separator
for numeric data using the DecimalSeparator
and
the ThousandsSeparator
properties.
Import data as logical
variables
from a text file.
For more information on properties of objects created by the detectImportOptions
function,
see SpreadsheetImportOptions
and DelimitedTextImportOptions
.
VideoReader
Object: Read video frames more quickly from MP4 and MOV files on Windows systemsThe VideoReader
object
now supports full rate reading for HD Videos.
imageDatastore
Function: Read batches of images for faster processing in machine learning and computer vision
applicationsNow read minibatches from the ImageDatastore
object
using the ReadSize
property. See imageDatastore
function.
TallDatastore
Object: Efficiently retrieve preprocessed and cleaned-up data saved using the write
function
of the MATLAB tall
arrays To speed up working with large data files use the TallDatastore
object
to recreate MATLAB tall
arrays from files
written to disk by the write
function.
You can use the TallDatastore
object to efficiently
load and work with data that has been previously preprocessed and
cleaned up.
jsondecode
, jsonencode
Functions: Encode and decode structured data in JSON-formatted textUse the jsondecode
function
to parse JSON text and convert it into MATLAB data types.
Use the jsonencode
function
to encode MATLAB data into JSON-formatted text.
writetable
Function: Support for writing missing fields of a table to a spreadsheet fileYou now can write blank cells in place of <missing> values
using the writetable
function.
readtable
, textscan
, tabularTextDatastore
and spreadsheetTextDatastore
Functions: Support string
data type using the 'TextType'
parameterThe functions readtable
, textscan
, tabularTextDatastore
,
and spreadsheetDatastore
support
the importing of text as a string
data type. For
example, to read any text variable in the file myfile.txt
as
a string
array, use T = readtable('myfile.txt','TextType','string')
.
For more information on string
arrays, see Characters and Strings.
weboptions
Function: Create custom HTTP headers and specify HTTPS certificatesTo create custom HTTP header fields, use the 'HeaderFields'
argument
in the weboptions
function.
To specify HTTPS certificates, use the 'CertificateFilename'
argument
in the weboptions
function.
The CDF library has been upgraded to version 3.6.1.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Errors | VideoWriter | Remove all instances of movie2avi . Write
to AVI files with VideoWriter . |
| Errors | Specify filename as a character row vector
or a string scalar. | When specifying the filename argument, the fopen function
no longer accepts a character column vector. Specify filename as
a character row vector or a string scalar. |
tall
Arrays: Manipulate and analyze data that is too big to fit in memoryTall arrays provide a way to work naturally with out-of-memory
data. Many MATLAB operations and functions work the same way
with tall arrays as they do with in-memory arrays. However, tall arrays
are not stored directly in memory and are evaluated by request using gather
. MATLAB automatically
optimizes the queued calculations by minimizing the number of passes
through the data. For more information, see Tall Arrays.
You can create tall numeric arrays, cell arrays, categoricals, strings, datetimes, durations, or calendar durations, and you can use any of these tall types as variables in a tall table. For more information, see Functions That Support Tall Arrays (A–Z).
ismissing
, standardizeMissing
, fillmissing
,
and rmmissing
You can clean missing data from an array or table using the following functions:
ismissing
—
Find elements with missing values.
standardizeMissing
—
Inserts missing value indicators.
fillmissing
—
Replaces missing values with a specified method, such as linear interpolation
or a constant value.
rmmissing
—
Removes missing entries.
'omitnan'
in cumsum
, cummin
, and cummax
discretize
Function: Discretize datetime
and duration
arrays to separate time-stamped data into regular time intervalsThe discretize
function
accepts datetime
and duration
arrays
as inputs.
You can pan or zoom in a single dimension using the new constrained options.
To pan in a single dimension, first enable panning
mode; for example, select the pan icon in the figure toolbar. Then,
click and drag the tick marks or tick labels of the x-axis, y-axis,
or z-axis to pan in that direction. The
visual indicates that
you are performing a constrained pan operation. Alternatively, right-click
the axes and set the pan constraint using the context menu. See
pan
for information about the programmatic
alternative.
To zoom in a single dimension, first enable zooming
mode; for example, select one of the zoom icons in the figure toolbar.
For 2-D plots, click and drag the mouse in approximately the horizontal
or vertical direction. The
visual indicates that
you are performing a constrained zoom operation. Alternatively, right-click
the axes and set the zoom constraint using the context menu. For 3-D
plots, use the context menu. See
zoom
for
information about the programmatic alternative.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
getAxesZoomMotion and setAxesZoomMotion object
functions for zoom objects | Still runs | getAxesZoomConstraint and setAxesZoomConstraint object
functions for zoom objects | Replaces all instances of getAxesZoomMotion with getAxesZoomConstraint .
Replace all instances of setAxesZoomMotion with setAxesZoomConstraint . |
getAxesPanMotion and setAxesPanMotion object
functions for pan objects | Still runs | getAxesPanConstraint and setAxesPanConstraint object
functions for pan objects | Replaces all instances of getAxesPanMotion with getAxesPanConstraint .
Replace all instances of setAxesPanMotion with setAxesPanConstraint . |
area
, bar
, contour
, histogram
, yyaxis
, and function plotsNow you can display most 2-D plots in your app. For more information, see Graphics Support in App Designer.
Add legends and color bars to your plots in App Designer. For more information, see Graphics Support in App Designer.
uitable
in appsUse App Designer to display tabular data in your app. Drag a Table component
onto the canvas and edit the Data
property in
the code view to display your data.
If your Table
component displays a large number
of rows and columns, you might notice a brief delay and a progress
indicator as you scroll through the table in your running app. The
delay occurs as MATLAB refreshes your data.
Write a callback function and share it among multiple components in your app. Right-click on a component in the canvas or the Component Browser and select Callbacks from the context menu. The Add Callback Function dialog box allows you to specify a new callback name or select from a list of existing callbacks.
The resizing behavior of labeled components is improved.
The names of labeled components are now based on the label text, making it easier to identify the components in the Component Browser and code view.
Ungrouped labels are accessible in the App Designer Component Browser by default.
Now you can edit the default value for a numeric edit field or spinner directly on the canvas.
Duplicate any component into a different parent container by pressing Ctrl, selecting the component, and dragging the duplicated component into the target container.
Click the Show Tips button in the App Designer code view to see a brief overview of the coding workflow. The tips point to specific areas of App Designer and guide you through the basic steps of creating an app.
Position
property uses 1-based origin The Position
property of App Designer components
uses a 1-based origin in pixel units. In R2016a, App Designer components
used a 0-based origin.
When you use R2016b to run an App Designer app created in R2016a, the UI components are shifted down and to the left by one pixel. You can use App Designer to correct the issue by opening and saving the app in R2016b before running it.
Similarly, when you use R2016a to run an App Designer app created in R2016b, the UI components are shifted up and to the right by one pixel.
ValueChangingFcn
property to execute a callback when users edit the value in the UIValueChangingFcn
is a new property for
the EditField
component. When you specify a callback
for the ValueChangingFcn
property, the callback
executes as the user edits the value at run time.
These containers include an OuterPosition
property
for accessing the location and size of their outer bounds. They also
include an InnerPosition
property for accessing
the location and size of their drawable area.
Panels — See Uipanel Properties for more information.
Button groups — See Uibuttongroup Properties for more information.
Tab Groups — See Uitabgroup Properties for more information.
uisetcolor
Function: Use the redesigned color picker to access recent colors and specify RGB valuesThe color picker that the uisetcolor
function
displays has been redesigned to include the following options:
A palette of standard colors at the top
A palette of recently selected colors in the center
RGB input fields that update the color preview as you edit the values
You no longer need to include files accessed using standard file format functions or low-level I/O functions. The Package App dialog box automatically includes:
Files that are accessed using standard file format functions. These dependent files include text, spreadsheets, images, audio, and video files. Scientific data formats are the only standard file formats that are not supported.
Files that are accessed using low-level I/O functions.
For a list of supported functions, see Standard File Formats. For a list of supported I/O functions, see Low-Level File I/O.
Graphics that contain large numbers of markers have improved performance and use less memory.
Performance is improved for MATLAB code that is dominated by tight loops, straightforward indexing, and simple math.
Performance is improved for creating simple objects in MATLAB.
Improvements apply to MATLAB and MathWorks Toolbox
objects (for example, datetime
, inputParser
)
and user-authored objects. For more information, see Object Constructors: Construct objects faster with certain
constraints.
The MATLAB Support Package for Android™ Sensors and the MATLAB Support Package for Apple iOS Sensors now work on the MathWorks Cloud.
For information about how to connect your Android device to the Cloud, see the "Use MATLAB on the MathWorks Cloud" subsection in "Set Up and Connect to Android Device" in the MATLAB Support Package for Android Sensors documentation.
For information about how to connect your Apple iOS device to the Cloud, see the "Use MATLAB on the MathWorks Cloud" subsection in "Set Up and Connect to Apple iOS Device" in the MATLAB Support Package for Apple iOS Sensors documentation.
Write to shift registers using the MATLAB Support Package for Arduino® Hardware.
You can use MATLAB commands to create pulse-width-modulated (PWM) signals and control servo motors from GPIO pins on the Raspberry Pi™ hardware. For more information, see MATLAB Support Package for Raspberry Pi Hardware.
You can use the MATLAB Support Package for Raspberry Pi Hardware with the Raspberry Pi 3 Model B hardware board.
You can use the MATLAB Support Package for Raspberry Pi Hardware with Raspberry Pi Sense HAT board to read from the sensors and joystick, and write to the LED matrix.
The components that you can communicate with from the support package are:
Humidity sensor - Read the relative humidity and the ambient temperature.
Pressure sensor - Read the barometric air pressure and the ambient temperature.
IMU sensor
Accelerometer - Read the linear acceleration along the x, y, and z axes.
Gyroscope - Read the angular velocity along the x, y, and z axes
Magnetometer - Read the magnetic field along the x, y, and z axes.
Joystick - Read the status of the joystick.
LED matrix - Write to a pixel, display an image, or display a message on the 8x8 RGB LED matrix.
Run Linux® and file management commands faster with performance
improvements to the system
, getFile
, putFile
,
and deleteFile
functions in the MATLAB Support Package for Raspberry Pi Hardware.
matlab.net.http
Object: Access HTTP services with low-level protocol controlFor more information, see HTTP Interface.
Call MATLAB functions and evaluate MATLAB statements from Java® programs synchronously or asynchronously. Java programs can pass data to and get data from the MATLAB base workspace. For more information, see MATLAB Engine API for Java.
Classes derived from matlab.mixin.SetGet
support inexact property
name matching by default in calls to set
and get
.
To require exact property name matching, derive your class from the matlab.mixin.SetGetExactNames
class.
Classes derived from matlab.mixin.SetGetExactNames
require
case-sensitive, exact property name matches in calls to the set
and get
methods.
Create easily readable, navigable, and archivable reports of
your test results using the TestReportPlugin
. You can
generate reports in .docx
and .pdf
formats.
For more information, see the matlab.unittest.plugins.TestReportPlugin
class.
TAPPlugin
Use the TAPPlugin
to produce a Test Anything
Protocol (TAP) stream of your test output. You can integrate this
stream into continuous integration systems like Jenkins™ or TeamCity®.
The new producingVersion13
method formats the stream
using version 13 of the TAP format. With this format, you can include
test diagnostics in YAML blocks. For more information, see the producingVersion13
method
of the TapPlugin
class.
As of R2016b, MATLAB scripts can contain local functions. You can use local functions in your script-based unit tests to promote code reuse and readability by defining helper functions for your tests. For an example of local, helper functions in a script-based test, see Write Script-Based Test Using Local Functions.
If you use the verifyThat
, assertThat
, assumeThat
,
or fatalAssertThat
qualifications with the IsSubstringOf
constraint
to test that an empty character vector is a substring of any nonempty
character vector, the qualification now passes. In previous versions
of MATLAB, this qualification failed. For example, the following
test now passes in MATLAB R2016b.
import matlab.unittest.constraints.IsSubstringOf tc = matlab.unittest.TestCase.forInteractiveUse; tc.verifyThat('',IsSubstringOf('any character vector'))
Prior to MATLAB release R2016b, tests such as testCase.verifyThat('',IsSubstringOf('any
character vector'))
failed. Update any tests that rely on
the previous behavior.
Significant overhead has been removed from object construction. These optimizations result in some changes in the behavior of object constructors, which are described in the next five items.
In previous releases, when an error occurred in the constructor, MATLAB called the class destructor only if an object property was assigned a value in the constructor. With release R2016b, MATLAB also calls the class destructor when an error occurs under these conditions:
A reference to the object is present in the code prior to the error.
An early return
statement is present
in the code before the error.
These changes mean that MATLAB calls class destructors in more cases than in previous releases. The destructor must be able to operate on partially constructed objects. For more information, see Support Destruction of Partially Constructed Objects.
In previous releases, constructors could return conditionally before calling the superclass constructor. With release R2016b, constructors cannot use early returns to conditionalize calls to the superclass constructor.
Revise any constructors that use returns to conditionalize calls to superclass constructors. For more information, see Subclass Constructors.
In previous releases, path changes that remove the class of the executing constructor from the path did not affect the visibility of the class. With release R2016b, changes to the path made by the constructor are applied immediately. This new behavior is the same as that of path changes made in ordinary methods.
If a constructor removes the class folder from the path, MATLAB cannot
access the class definition. The constructor can use the mlock
function to keep the class definition
in memory if changing the path in the constructor is necessary.
Error IDs have changed for certain constructor-related errors. These changes include the IDs for errors thrown for these conditions:
Too many inputs
Too many outputs
Too few inputs
Too few outputs
Illegal superclass constructor call
Update any error handlers that rely on specific error IDs.
If an object constructor does not return the constructed object, MATLAB does
not trigger the InstanceCreated
event. For more
information, see Output Object Not Assigned.
You cannot listen for the InstanceCreated
event
if an object constructor does not return the constructed object to
the caller.
MATLAB supports passing empty (0-length) Java arrays
to Java methods that take an array of type other than Object
.
Before MATLAB release R2016b, MATLAB converts zero-length Java arrays
to null when the method takes an array of type other than Object
.
MATLAB supports the following versions of CPython:
Version 2.7
Version 3.3
Version 3.4
Version 3.5
For more information, see Install Supported Python Implementation.
Support for Python® version 3.3 will be discontinued in a future release.
To ensure continued support for your applications, consider upgrading to another supported version of Python — version 3.4 or 3.5.
Use the MATLAB Comparison tool to review changes to files such as live scripts and MAT-files from your external source control client. For more information, see Customize External Source Control to Use MATLAB for Diff and Merge.
To reuse code from another repository, you can specify Git™ submodules. For more information, see Add Git Submodules.
Remove stale working copy locks using the SVN Cleanup option. For more information, see Get SVN File Locks.
Support | Compiler | Platform |
---|---|---|
Added | GNU® gcc and gfortran version 4.9 Support for GNU gcc and gfortran version 4.7 is discontinued. | Linux |
Added | Intel® Parallel Studio XE 2016 for Fortran Intel Parallel Studio XE 2015 for Fortran | Mac OS X |
Discontinued | Microsoft® Visual Studio® 2010 Professional | Windows |
To be phased out | Visual C++® 2012 Professional Apple Xcode 6.2 | Windows Mac OS X |
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.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Still runs | To enforce exact property name match, derive from | Subclasses of |
Generating test suites from a class that derives from
a concrete base class that defines methods which reference a | Still runs | Define either the:
| In future releases, if your test class inherits from a concrete base class that uses a parameter that is not defined in the base class, MATLAB will throw an error. |
Calling | Errors | Replicate the | The |
Calling scripts from class methods | Errors | Local functions defined in the class file have access to class members and might provide an alternate approach. | Class methods that call scripts that access private or protected class members from the script cause illegal access errors. |
'IgnoringCase' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator , and StructComparator | Errors | 'IgnoringCase' option of the IsEqualTo constraint | Replace all instances of 'IgnoringCase' in
the CellComparator , PublicPropertyComparator , or StructComparator constraint with 'IgnoringCase' in
the IsEqualTo constraint. |
'IgnoringWhitespace' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator , and StructComparator | Errors | 'IgnoringWhitespace' option of the IsEqualTo constraint | Replace all instances of 'IgnoringWhitespace' in
the CellComparator , PublicPropertyComparator , or StructComparator constraint with 'IgnoringWhitespace' in
the IsEqualTo constraint. |
'Within' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator , and StructComparator | Errors | 'Within' option of the IsEqualTo constraint | Replace all instances of 'Within' in the CellComparator , PublicPropertyComparator , or StructComparator constraint with 'Within' in
the IsEqualTo constraint. |
Live scripts combine code, output, and formatted content together in a single interactive environment called the Live Editor. Add formatted text, images, hyperlinks, and equations to create an interactive narrative that can be shared with others.
In the Live Editor you can:
Write, execute, and test code in a single interactive environment
Generate results and graphics alongside the code that produced them.
Run blocks of code individually or run the whole file.
See errors at the location in the file where they occur.
Include mathematical equations, images, and hyperlinks as supporting material.
Share live scripts with other MATLAB users or
convert them to HTML
or PDF
for
publication.
For more information about live scripts, including incompatibilities and information about the Live Script file format, see What Is a Live Script?.
matlab.addons.toolbox
packageInstall, uninstall, query, and package toolboxes programmatically.
To package toolboxes, use the matlab.addons.toolbox.packageToolbox
function.
To query or modify the version of a toolbox, use the matlab.addons.toolbox.toolboxVersion
function.
To install a toolbox, use the matlab.addons.toolbox.installToolbox
function.
To uninstall a toolbox, use the matlab.addons.toolbox.uninstallToolbox
function.
For information about installed toolboxes, use the matlab.addons.toolbox.installedToolboxes
function.
Complete parameter names and options when entering commands
in MATLAB. For example, if you type plot(1:10,'
and
press the Tab key, MATLAB displays a list of
possible parameter names and options for the plot
function.
Completion of parameters and options is not available for all functions.
To pause the execution of a program while it is running, in
the Editor tab, click the Pause
button. MATLAB pauses
execution at the next executable line.
You can indicate which folders are excluded from the user's MATLAB path when they install your toolbox. By default, any of the toolbox folders that are on your path when you create the toolbox are added to the user's path. For more information, see Create and Share Toolboxes.
MATLAB can now migrate preferences from MATLAB versions
up to three releases immediately preceding the release starting up.
For example, if you start MATLAB R2016a
for
the first time and a preferences folder exists for R2014b
, MATLAB migrates
the preferences from R2014b
to R2016a
.
If two or more preferences folders for the previous three releases
exist, MATLAB imports the preferences from the latest preferences
folder. For more information, see Preferences
MATLAB Uses When Multiple Releases Are Installed.
On Mac platforms, migrating preferences might result in an out-of-date MEX options file. For more information, see SDK "macosx10.8" cannot be located Error Message.
Currently, the default encoding scheme on Mac platforms is determined by the OS X user locale setting. In a future release, the default encoding scheme will be UTF-8.
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 load the files properly.
Do not convert text files to UTF-8 if you share them with users on Windows platforms.
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:
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
.
Close MATLAB if it is currently running.
Start MATLAB by double-clicking the MATLAB icon in the Applications folder.
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:
Open a MATLAB text file with TextEdit.
Select File -> Save as...
Change the file name.
Change Plain Text Encoding: to Unicode
(UTF-8)
.
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')
datetime
Object: Set the default locale and format of datetime
objects through the Preference
panelView and modify the default locale and format of datetime
objects
in the Command Window Preferences. For more information, see Set
Command Window Preferences.
zeros
, ones
, and eye
Functions: Create logical
arrayscellstr
, deblank
, and strtrim
Functions: Keep significant whitespace characters when removing leading or trailing
whitespace The cellstr
, deblank
,
and strtrim
functions
no longer remove significant leading or trailing whitespace characters,
such as nonbreaking space characters. The most common whitespace characters
that are significant are char(133)
, char(160)
, char(8199)
,
and char(8239)
.
Prior to MATLAB release R2016a, the cellstr
, deblank
,
and strtrim
functions removed all leading or trailing
whitespace characters, including significant whitespace characters.
rowfun
and varfun
Functions: Create output table without row names when using the 'GroupingVariables'
parameter The rowfun
and varfun
functions
no longer add row names to the output table when you use the 'GroupingVariables'
parameter
to specify the grouping variables.
Prior to MATLAB release R2016a, the rowfun
and varfun
functions
added row names to the output table when using the 'GroupingVariables'
parameter.
To add row names, assign them to the RowNames
property
of the output table. For more information on table properties, see Table
Properties
.
You can now set breakpoints at any time, whether MATLAB is idle or busy running a file.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
Calling | Still runs | Move calls to | If you call |
Visibility of local functions | Still runs | Store the function handle to the local function in a
variable and use that instead of the call to the local function. For
example, assign | In future releases, local functions are visible only to other functions in the same file. Currently, if a function file that defines local functions invokes a script, that script can call those local functions. |
Visibility of private functions | Still runs | Moving scripts that need access to private functions
to the folder immediately above the | In future releases, private functions are visible only
to other functions or scripts in the folder immediately above the |
| Warns | Replace all instances of |
movmean
, movsum
, movmedian
, movmax
, movmin
, movvar
,
and movstd
functionsdatetime
and duration
Arrays: Compute standard deviations with std
The std
function
can calculate the standard deviation of a datetime
or duration
array.
datetime
and duration
Arrays: Ignore NaNs and NaTs using 'omitnan'
or 'omitnat'
in
the functions mean
, median
, std
,
and sum
graph
and digraph
Classes: Analyze graphs and networks using centrality and nearest nodes functionsThe centrality
function computes
several different types of node centrality, such as 'degree'
, 'betweenness'
,
and 'pagerank'
. The nearest
function calculates
the nearest nodes within a specified distance of a source node.
svds
Function: Compute singular values with improved performance and convergence behavior with a wide variety
of matrices The algorithm of the svds
function
shows improved performance and convergence behavior with a wide variety
of matrices.
Three new options for sigma
are being introduced
to svds
to calculate the largest and smallest
singular values of a matrix: 'largest'
, 'smallest'
,
and 'smallestnz'
. Previously, using a value of 0
for sigma
was
common when calculating the smallest singular values.
svds(A,k,0)
now returns a warning. Use svds(A,k,'smallest')
to
find the smallest singular values instead.
median
Function: Compute medians with improved performanceThe median
function
computes the median of an array faster.
cummin
, cummax
, cumprod
, and cumsum
Functions: Compute cumulative minimum,
maximum, product, and sum with improved performanceGraphPlot
Objects: Interactively inspect graph plots using data cursor and plot selectionYou now can use the data cursor to select nodes in a graph and display basic information, such as the node ID and degree. See Display Data Values Interactively for more information about data cursors, or Add Node Properties to Graph Plot Data Cursor for an example involving a graph plot.
Selecting a graph plot also enables the use of plot tools to interact with the graph, such as Plot Browser and Property Editor. See Customize Graph Using Plot Tools for more information.
polarplot
Function: Plot data in polar coordinates and modify properties of polar axesTo plot data in polar coordinates, use the polarplot
function.
You can modify the resulting polar axes, such as changing the limits
or orientation, by setting Polar Axes
Properties.
The polarplot
function supersedes the polar
function.
yyaxis
Function: Create charts with two y-axes and customize each y-axis individuallyTo create charts with two y-axes, use the yyaxis
function.
You can plot data against either y-axis using
common charting functions, such as plot
or errorbar
.
You can customize each y-axis by setting properties
of the axes object.
The yyaxis
function supersedes the plotyy
function.
For an example of its use, see Create
Chart with Two y-Axes.
To add a title to a legend, use the new Title
property
of the legend or using the title
function, for
example:
plot(rand(3)) l = legend('Line 1','Line 2','Line 3'); title(l,'My Legend')
Also, now you can highlight charts in the axes when you click
the associated legend item. Set the new ItemHitFcn
property of
the legend to a callback function that changes properties of the charts.
For an example, see Create
Interactive Legends Using Callbacks.
histogram2
Function: Enable data linking and brushing for bivariate histogramsYou now can link and brush data in histogram2
plots.
Plot mathematical expressions using a family of new and updated
function plots. These functions supersede the existing ez
family
of functions, such as ezplot
.
fplot
plots
2-D lines, including parametric lines. Supersedes ezplot
.
fplot3
plots
3-D parametric curves. Supersedes ezplot3
.
fcontour
plots
2-D contours. Supersedes ezcontour
.
fsurf
plots
3-D surfaces, including parametric surfaces. Supersedes ezsurf
.
fmesh
plots
3-D meshes, including parametric meshes. Supersedes ezmesh
.
The behavior of fplot
changed
in these ways:
Issues a warning when using a string to define the function to plot. Instead, use an anonymous function or a function handle.
Issues a warning when returning two output arguments.
Instead, return the function line object and use its XData
and YData
properties.
No longer supports specifying the y-axis
limits as an input argument. Instead, use the ylim
function.
No longer supports specifying the number of evaluation
points as an input argument. Instead, specify the MeshDensity
property.
No longer supports specifying the error tolerance as an input argument.
Graphics that contain markers have improved performance and
quality. For more information, see opengl
.
For axes in a 3-D view, panning and zooming now shift the view of the data by modifying the axis limits, instead of moving the entire axes. The axes box stays in the same location within the figure. Previously, panning and zooming modified camera properties, which moved the entire axes around within the figure.
If you have an axes in a 3-D view, then the behavior of pan and zoom is different. For the old behavior, use one of these options:
Use the context menus when in pan or zoom mode. For example, when you are in zoom mode, right-click over the axes and select 3D Options > Camera Pan and Zoom.
Use the setAxes3DPanAndZoomStyle
function
to specify the behavior, for example:
ax = gca;
z = zoom;
setAxes3DPanAndZoomStyle(z,ax,'camera')
Use the camera toolbar. To view the camera toolbar, select View > Camera Toolbar from the figure menu.
If you are using a Windows NVIDIA® graphics driver older than version 9.18.13.4052 (or 340.52 in NVIDIA driver version convention), then MATLAB reverts to using software OpenGL® instead of hardware-accelerated OpenGL. Hardware-accelerated OpenGL is not available by default due to known instabilities with the driver when running MATLAB. To take advantage of all the visual and performance benefits of hardware-accelerated OpenGL, update your graphics driver to the latest version. For more information, see System Requirements for Graphics.
Printed and saved figures now match the size of the figure on
the screen by default. Previously, printed and saved figures were 8
-by-6
inches
by default. This change affects figures printed to a printer or saved
to a bitmap image or vector graphics file format, for example, using
the print
and saveas
functions.
The size of printed or saved figures might be different because
now the default value for the PaperPositionMode
property
of figures is 'auto'
instead of 'manual'
.
To get the previous behavior, set the default value back to 'manual'
using
one of these techniques:
Use the new print preference option. Print preferences
persist across MATLAB sessions. You can set the print preference
to either 'auto'
(new behavior) or 'manual'
(previous
behavior), for example:
matlab.graphics.internal.setPrintPreferences('DefaultPaperPositionMode','manual')
'auto'
or 'manual'
.
If you did not set a preference, then the command returns 'unset'
.matlab.graphics.internal.getPrintPreferences
Set the default value on the root object. This option affects only new figures in the current MATLAB session.
set(groot,'defaultFigurePaperPositionMode','manual')
PaperPosition
property
to 'default'
, for example:set(gcf,'PaperPosition','default')
print
Function: Print figures that fill page using the '-fillpage'
and '-bestfit'
optionsPrint or save figures that fill the page using the new '-fillpage'
and '-bestfit'
options
for the print
function.
These options maximize the size of the figure while leaving a minimum
page margin of 0.25 inch. The '-bestfit'
option
preserves the figure's aspect ratio. The '-fillpage'
option
ignores the aspect ratio. Both options are valid only when printing
a figure to a printer or saving it to a paged format (PDF and full
page PostScript®).
PaperPosition
value using File > Save As When you save a figure using File > Save
As, the size of the saved figure now honors the figure's PaperPosition
property
value. By default, the PaperPosition
property recalculates
according to the size of the figure on the screen. As a result, the
saved figure matches the size of the figure on the screen. However,
if you change the PaperPosition
property value,
then the saved figure uses the specified size. Previously, the saved
figure matched the size of the figure on the screen regardless of
the PaperPosition
property value. For the old behavior,
set the figure's PaperPositionMode
property to 'auto'
before
saving the figure:
set(gcf,'PaperPositionMode','auto')
The size of saved figures might be different.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
plotyy function | Still runs | yyaxis | Replace all instances of plotyy with yyaxis . |
polar function | Still runs | polarplot | Replace all instances of polar with polarplot . |
ezplot function | Still runs | fplot | Replace all instances of ezplot with fplot . |
ezplot3 function | Still runs | fplot3 | Replace all instances of ezplot3 with fplot3 . |
ezcontour function | Still runs | fcontour | Replace all instances of ezcontour with fcontour . |
ezcontourf function | Still runs | fcontour | Replace all instances of ezcontourf(...) with fcontour(...,'Fill','on') . |
ezsurf function | Still runs | fsurf | Replace all instances of ezsuf with fsurf . |
ezsurfc function | Still runs | fsurf | Replace all instances of |
ezmesh function | Still runs | fmesh | Replace all instances of ezmesh with fmesh . |
ezmeshc function | Still runs | fmesh | Replace all instances of |
PaperPositionMode property of figure
objects | Default value now 'auto' | Not applicable | Printed and saved figures now match the size of the figure on the screen by default. |
[l,icons,plots,txt] = legend(__) syntax | Still runs | l = legend(__) syntax | Remove all instances of the [l,icons,plots,txt] =
legend(__) syntax. You can make some modifications to the
legend by returning the legend object and setting legend properties
instead. For a list, see Legend Properties.
For information on new legend properties, see Legend Object: Add legend title and create callbacks to highlight
plots when clicking legend items. |
App Designer is a rich application development environment for developing apps. Major App Designer features include:
Numerous user interface components
In addition to standard components, such as buttons, check boxes, and panels, App Designer also offers gauges, lamps, knobs, and switches.
Integrated editor, property sheets, and property inspector
The editor generates code as you lay out your app and customize component properties. The editor has coding alerts and many of the debugging features that are available in the MATLAB Editor. The integrated property sheets enable you to set commonly used properties for components, such as default component values, text, and text font styles. The property inspector provides access to all writable properties.
Enhanced code structure
App Designer generates code based on your component selection and layout. App Designer structures the code for readability and does not generate unnecessary code. In addition, Areas that App Designer manages are set to read-only access, so you cannot accidently overwrite or delete required code.
If you built apps using GUIDE in the past, be aware that there are some important differences between GUIDE and App Designer in terms of functionality and support for graphics workflows. For more information, see:
To get started using App Designer, see Create Simple App Using App Designer.
writetable
Function: Write to text files significantly faster, especially for large filesPerformance improvement of the writetable
function
increases with table size.
readtable
Function: Read from Excel files with faster performanceThe readtable
function
reads faster from Excel® files.
writetable
Function: Write to Excel files on Mac and Linux platforms In addition to Windows, the writetable
function
now writes to Excel files on Mac and Linux.
If you specify a range that exceeds the data being written,
then writetable
will not write to those cells.
Previously, writetable
filled the remaining cells
with #N/A
.
When writing NaT
datetime
values
or <undefined>
categorical
values, writetable
writes
empty cells instead of NaT
and <undefined>
,
respectively.
spreadsheetDatastore
Function: Import and process data from a collection of Excel filesThe spreadsheetDatastore
function
creates a SpreadSheetDatastore
object for processing
large collections of Excel files.
datastore
Function: Import a TabularTextDatastore
object with improved file format detection The datastore
function
now detects file formatting more accurately when creating a TabularTextDatastore
object.
The datastore
function now automatically
includes only files with extensions .txt
, .csv
, .dat
, .dlm
, .asc
,
and .text
by default.
If you want to include unsupported text file extensions, then
specify them using the 'FileExtensions'
parameter
in the datastore
function.
ImageDatastore
Object: Specify image labels using the Labels
property and process with splitEachLabel
, countEachLabel
,
and shuffle
functionsYou now can organize an ImageDatastore
according
to specified labels using the Labels
property.
When creating an ImageDatastore
object, you can
use the LabelSource
parameter to assign label names
according to the file folder names. Labeling is useful for workflows
in machine learning and neural networks, for example.
The splitEachLabel
function
creates new ImageDatastore
objects according to
a specified number or percentage of images from each label. splitEachLabel
can
also draw images randomly. This function is useful for testing and
training sets, for example.
The countEachLabel
function
creates a summary table of all labels in the ImageDatastore
and
how many files belong to each.
The shuffle
function randomly
reorders the files in the original ImageDatastore
and
creates a new one.
fileDatastore
Function: Create a custom datastore for a file collection too large to fit in memoryThe fileDatastore
function
creates a custom FileDatastore
object that uses
a specified custom read function to import the files.
readtable
Function: Read text files with automatic detection of delimiters, header lines, and variable names The readtable
function
automatically detects delimiters, header lines, and variable names
in text files.
You can restore the previous readtable
defaults
by specifying the delimiter, header line, or variable name parameter
values explicitly, for example, readtable('file.txt','Delimiter',',','HeaderLines',0,'ReadVariableNames',true);
tabularTextDatastore
and imageDatastore
Functions: Create objects to import large text and image data collectionsYou now can use the tabularTextDatastore
function
to conveniently create a TabularTextDatastore
object
for large collections of text files.
You can use the imageDatastore
function
to conveniently create an ImageDatastore
object
for large collections of image data.
writetable
Function: Detect text with embedded delimiters automatically and write as quoted textThe writetable
function
automatically detects and adds quotations around text, categorical
,
and datetime
variables containing an embedded delimiter
(such as '\t'
).
TabularTextDatastore
Objects: Read text files with automatic detection of delimiters, header lines, and variable
names You now can read from a TabularTextDatastore
object
with automatic detection of the Delimiter
, NumHeaderLines
,
and ReadVariableNames
properties. For more information,
see TabularTextDatastore
Properties.
You can restore the previous TabularTextDatastore
defaults
by specifying the delimiter, header line, or variable name parameter
values explicitly, for example, tabularTextDatastore('file.txt','Delimiter',',','NumHeaderLines',0,'ReadVariableNames',true);
imread
Function: Generate C-code using MATLAB CoderThe imread
function
generates C-code for 8-bit grayscale and 24-bit truecolor JPEG images
using a platform-specific shared library.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
KeyValueLimit property of the KeyValueDatastore class | Errors | ReadSize property of KeyValueDatastore class | Replace all instances of KeyValueLimit with ReadSize . |
RowsPerRead property of the TabularTextDatastore class | Errors | ReadSize property of TabularTextDatastore class | Replace all instances of RowsPerRead with ReadSize . |
Folders and wildcard (*) characters in the Files property
of the KeyValueDatastore and TabularTextDatastore classes | Errors | Full paths and file names | Replace all folder names or wildcard characters with full path
and file names when assigning to the Files property. |
Measure the performance of your MATLAB code using the performance testing framework. The framework includes performance measurement-oriented features such as running your code several times to "warm-up" the code and accounting for noise in the measurements.
The performance test interface leverages the script, function, and class-based unit testing interfaces. Therefore, you can perform qualifications within your performance tests to ensure correct functional behavior while measuring code performance. Also, you can run your performance tests as standard regression tests to ensure that code changes do not break performance tests.
For more information, see Performance Testing Framework.
Graphics that contain markers have improved performance and
quality. For more information, see opengl
.
writetable
Function: Write to text files significantly faster, especially for large filesPerformance improvement of the writetable
function
increases with table size.
readtable
Function: Read from Excel files with faster performanceThe readtable
function
reads faster from Excel files.
median
Function: Compute medians with improved performanceThe median
function
computes the median of an array faster.
Use the MATLAB Support Package for Raspberry Pi Hardware to bring live images into MATLAB from USB webcams attached to your Raspberry Pi hardware board.
With simple MATLAB functions preview and acquire single
snapshots from the camera, and optionally set up a loop of acquired
images. The webcam
function creates the USB Camera
object used to acquire images, and the snapshot
function
returns a single image from the camera.
MATLAB Support Package for Arduino Hardware provides a framework of classes that you can use to create custom applications to use with your Arduino device. The custom applications can be code, libraries, or devices that work with an Arduino. For more information, see Custom Arduino Add-On Device, Library, and CodePerformance Testing Framework in the MATLAB Support Package for Arduino Hardware documentation.
To install the support package, on the MATLAB Home tab, in the Environment section, click Add-Ons > Get Hardware Support Packages.
Measure the performance of your MATLAB code using the performance testing framework. The framework includes performance measurement-oriented features such as running your code several times to "warm-up" the code and accounting for noise in the measurements.
The performance test interface leverages the script, function, and class-based unit testing interfaces. Therefore, you can perform qualifications within your performance tests to ensure correct functional behavior while measuring code performance. Also, you can run your performance tests as standard regression tests to ensure that code changes do not break performance tests.
For more information, see Performance Testing Framework.
testsuite
functionUse the testsuite
function to create a
suite of tests from your current working folder or from specified
test content. If you have an explicit test suite, you can use test
selectors and test runners.
In previous releases of MATLAB, you create explicit test
suites with the methods in the matlab.unittest.TestSuite
class.
The testsuite
function
provides a more convenient means to create test suites.
You can programmatically access the diagnostic information on
test results using a DiagnosticsRecordingPlugin
.
The DiagnosticsRecordingPlugin
class records
test qualification failures and events logged at Terse
verbosity.
However, you can configure the plugin to record passing diagnostics
and logged messages at different verbosity levels.
If you run tests with the runtests
function
or the run
method of TestSuite
or TestCase
,
then the test framework uses a DiagnosticsRecordingPlugin
plugin
by default. Also, if you run performance tests with the runperf
function
or the run
method of TimeExperiment
,
then the test framework uses this plugin by default.
For more information, see matlab.unittest.plugins.DiagnosticsRecordingPlugin
.
WorkingFolderFixture
The matlab.unittest.fixtures.WorkingFolderFixture
class
provides a fixture that creates a temporary folder and sets it as
the current working folder. The test or the product under test can
create files and modify the contents of the folder without affecting
the source code or test folder structure.
Although both the WorkingFolderFixture
and TemporaryFolderFixture
classes
create a temporary folder, the WorkingFolderFixture
also
sets the folder as the current working folder. At fixture teardown,
the testing framework restores the current working folder to its previous
state.
For more information, see matlab.unittest.fixtures.WorkingFolderFixture
.
HasUniqueElements
, IsSubsetOf
,
and IsSupersetOf
constraintsYou can test set membership and uniqueness of the actual value
set using set constraints in the matlab.unittest.constraints
package.
For example:
HasUniqueElements
tests
if an actual value set has unique elements.
IsSubsetOf
tests
if an actual value set is a subset of the expected value set.
IsSupersetOf
tests
if an actual value set is a superset of the expected value set.
The matlab.unittest.fixtures.Fixture
class enables
you to create custom fixtures to configure the environment state required
for tests. The applyFixture
method of the Fixture
class
enables your custom fixture to delegate work to another fixture. When
the testing framework tears down the custom fixture, it also tears
down the fixture you used to set it up.
For more information, see matlab.unittest.fixtures.Fixture.applyFixture
.
When you compare structures using the IsEqualTo
or StructComparator
classes,
specify which fields to ignore using the 'IgnoringFields'
name-value
pair argument.
When you compare objects using the PublicPropertyComparator
with
the supportingAllValues
static
method, specify which properties to ignore using the 'IgnoringProperties'
name-value
pair argument. If the values are structures, then specify which fields
to ignore using the 'IgnoringFields'
option.
PathFixture
fixture adds folders to the pathNow,you can create a PathFixture
fixture
that includes subfolders of the specified folder on the path. For
more information, see the 'IncludingSubfolders'
name-value
pair argument of PathFixture
.
Additionally, you can have the PathFixture
fixture
add the folder to the end (bottom) of the path. By default, the
fixture adds a folder to the beginning (top) of the MATLAB path. For
more information, see the 'Position'
name-value
pair argument of PathFixture
.
Restrict property values to a specified class or a class compatible with the specified class. For more information, see Restrict Class of Properties.
Define only one property per line in the property block of a
class definition. Also, you cannot define properties on the same line
as the properties
or end
keywords.
In releases R2016a, MATLAB interprets any name following a property name as a restricting class. The second name is not interpreted as a property name. More than two names on a line cause an error. A single line in a property block can contain the property name, an optional restricting class, and an optional default value. Default values must be of a class that is compatible with the class restriction.
properties PropName ClassName = defaultValue; end
You must change any existing property blocks that list more than one property per line to list only one property per line. The following list describes cases that you must change:
The properties
keyword is on the
same line as property names.
The end
keyword is on the same
line as property names.
The entire properties block is on one line using white-space separators.
More than two property names are on one line.
MATLAB interprets two property names on one line as a restricted property. If the second name is not a valid class name, MATLAB generates an error.
The event.hasListener
function
returns a logical true
or false
indicating
if listeners exist for a specific event name and event source.
The PropertyAdded
and PropertyRemoved
events
provide an event.DynamicPropertyEvent
object
as the event data that is passed to listeners of those events. This
event data object has a property, PropertyName
,
that contains the name of the dynamic property whose addition or removal
triggered the respective event.
Enumerations have improved compatibility with character arrays and cell arrays of strings. This compatibility enables conversion of characters to enumerations and the use of enumeration members in set membership and string comparison functions. For more information, see Conversion of Characters to Enumerations and Operations on Enumerations.
With release R2016a, the waitfor
function
works with any instance of a MATLAB handle class.
If you are using Git for source control, you can view information about your current branch relative to the remote tracking branch in the repository. Right-click the file or white space of the Current Folder browser and select Source Control > View Details. The Git information field indicates whether your committed local changes are ahead of, behind, or coincident with the remote tracking branch.
If you have folders in your source control repository, the Current Folder browser shows an icon for the folder that summarizes the status of the contents of the folder. The tooltip for the icon displays a summary of the changes in the folder.
If the source control system supports storing folders, the Current
Folder browser displays the appropriate status icon for the folder
and its contents. Otherwise, it displays either a dot indicating that
the folder is not under source control or the Modified icon
to indicate that files
within the folder are modified. SVN supports storing folders, but Git does
not.
You can start the MATLAB Engine for Python asynchronously
using the async
keyword argument in the matlab.engine.start_matlab
and matlab.engine.connect_matlab
commands.
MATLAB builds with an updated version of the Boost library, version 1.56.0.
If you use any Boost library in a MEX function, you might not be able to load that function if you do not use Boost library version 1.56.0.
.bat
or .sh
compiler options filesThe mex
command -f
option
does not accept arguments with .bat
or .sh
file
extensions.
Instead of using the -f
option to specify
a compiler, use the work flows described in Change
Default Compiler.
You can modify compiler build options using mex
command
options. For example, use the -L
and -I
options
to locate libraries on your system. Use the
option
to pass options to the compiler.varname
=varvalue
For the complete list of mex
command
options, see the option1 ... optionN
input argument.
Support | Compiler | Platform |
---|---|---|
Added | Intel Parallel Studio XE 2016 Intel Parallel Studio XE 2015 Intel C++ Composer XE 2013 with Microsoft Visual Studio 2013 | Windows |
Added | Apple Xcode 7.x | Mac OS X |
Discontinued | Microsoft Visual Studio 2008 Professional Edition Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 Intel Visual Fortran Composer XE 2011 with Microsoft Visual Studio 2010 | Windows |
To be phased out | Microsoft Visual Studio 2010 Professional Edition Microsoft Windows SDK 7.1 | Windows |
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.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
Calling | Still runs | Replicate the | In future releases, the |
Calling | Still runs | In future releases, most of the calls to | In future releases, calling |
Calling scripts from class methods | Still runs | Local functions defined in the class file have access to class members and might provide an alternate approach. | In future releases, class methods that call scripts that access private or protected class members from the script cause illegal access errors. |
'Recursively' option of runtests | Still runs | 'IncludeSubfolders' and 'IncludeSubpackages' options
of runtests | In calls to runtests , replace all instances
of 'Recursively' with 'IncludeSubfolders' and/or 'IncludeSubpackages' |
Creating a dynamic property with an invalid name | Errors | For valid names, see Name Dynamic Properties. | Creating a dynamic property with an invalid name causes an InvalidDynamicPropertyName error.
Previous releases issued a warning. |
'IgnoringCase' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator ,
and StructComparator | Warns | 'IgnoringCase' option of the IsEqualTo constraint | Replace all instances of 'IgnoringCase' in
the CellComparator , PublicPropertyComparator ,
or StructComparator constraint
with 'IgnoringCase' in the IsEqualTo constraint. |
'IgnoringWhitespace' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator ,
and StructComparator | Warns | 'IgnoringWhitespace' option of the IsEqualTo constraint | Replace all instances of 'IgnoringWhitespace' in
the CellComparator , PublicPropertyComparator ,
or StructComparator constraint
with 'IgnoringWhitespace' in the IsEqualTo constraint. |
'Within' option of these matlab.unittest.constraints classes: CellComparator , PublicPropertyComparator ,
and StructComparator | Warns | 'Within' option of the IsEqualTo constraint | Replace all instances of 'Within' in the CellComparator , PublicPropertyComparator ,
or StructComparator constraint
with 'Within' in the IsEqualTo constraint. |
Add-ons extend the capabilities of MATLAB by providing additional functionality for specific tasks and applications, such as connecting to hardware devices, additional algorithms, and interactive apps. Add-ons encompass a wide variety of resources, including products, apps, support packages and toolboxes, and are available from MathWorks and from the global MATLAB user community.
Using the new Add-On Explorer, you can browse and install available add-ons directly from MATLAB.
To access the Add-On Explorer in MATLAB, go to
the Home tab and click the Add-Ons
icon.
To manage installed add-ons, go to the Home tab, and select Add-Ons > Manage Add-Ons.
For more information, see the Add-Ons documentation.
To continue using your apps and custom toolboxes from previous MATLAB installations, you must migrate them to the current release:
On the Home tab, select Add-Ons > Manage Add-Ons.
Click the Import button.
The 2015b release includes a redesigned left-side navigation pane to facilitate topic exploration. From this pane you can:
View the current product, as well as adjacent categories relevant to your current area of focus.
Access basic product links such as getting started
information, examples, functions and other references, release notes,
and PDF documentation. Click the
icon to the right of
the product name to bring up available options.
Explore and navigate faster through subsections of
a page. Click a subsection title to access its content. For example,
suppose you want to view all the input arguments for the imshow
function.
Open the function reference page and in the left-side navigation pane,
click Input Arguments.
Product pages and their primary categories now contain enhanced introductory material. New features include product and category overviews, images, quick links, and featured examples.
A redesigned search bar is more visible on every page throughout the documentation. You now can easily find and use the search tool whenever you need it.
New keyboard shortcuts allow better navigation of the MathWorks documentation.
Action | Keyboard Shortcut |
---|---|
Open a new browser tab. | Ctrl + T |
Open a new browser window. | Ctrl + N |
Go to the Help browser home. | Alt + Home |
Reopen the last closed Help browser. | Ctrl + Shift + T |
Increase or decrease the font size of the Help browser. | Ctrl + Mouse Scroll |
Open a link in a new tab. | Ctrl + Mouse Click or Mouse Center Click |
Font size now persists over multiple MATLAB Help browser and MATLAB Web browser sessions. To adjust the font size, use the Ctrl + Mouse Scroll keyboard shortcut.
MATLAB now ensures command completions have the correct
capitalization. For example, if you type help Contain
and
press Tab, MATLAB displays help containers
in
the command line.
When calling the help
command,
you receive suggested corrections for mistyped function names. Press Enter to
accept the suggestion or Esc to cancel.
The appearance of the MATLAB desktop is improved for these system configurations:
Macintosh systems with Apple Retina displays.
Windows systems in which the DPI (dots-per-inch) value is higher than 96.
The MATLAB Desktop is now properly scaled and sharper on these systems than in previous releases. Be aware that the icons in the Toolstrip might still look slightly blurry on some systems.
For more information about the DPI-aware changes to MATLAB, see DPI-Aware Behavior in MATLAB.
The Toolstrip, Command Window fonts, and Editor fonts might be larger than in previous releases. These differences might occur on Windows systems in which the display DPI value is higher than 96. If you have nondefault font sizes selected in MATLAB preferences, you might need to adjust those font sizes to make them look smaller.
When publishing a document on a high-DPI system, the images saved to disk are larger than in previous releases or on other systems.
findgroups
and splitapply
Functions: Split data into groups and apply functions to each group of dataThe findgroups
function
finds groups within grouping variables. Use these groups and splitapply
to
split data out of data variables and apply functions to each group
of data.
NaT
Function: Create array of Not-a-Time valuesThe NaT
function
creates an array of Not-a-Time (NaT) values to represent unknown or
missing datetime values.
timezones
Function: Display list of time zone namesThe timezones
function
displays a list of IANA time zone names that you can use as inputs
to the datetime
function.
timeofday
Function: Calculate duration on days of Daylight Saving Time (DST) shift help
Command: Specify a variable as input to the help
command instead of specifying the
variable class nameYou can get help using a variable by specifying it as an input
to the help
command. For example if you have
a variable t = datetime
, calling the command help
t
displays help text for the datetime
class.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
clear | Still runs | Depends on usage | The The Calling |
Assign to a nonstructure variable as if it were a structure | Errors | Assign to a field of a new variable, or use the | If a variable exists and is not a structure, and you assign a field as if the variable were a structure, MATLAB throws an error. For example, a = 1; a.b = 2; returns an error in MATLAB 8.6 and later: Field assignment to a non-structure array object. Similarly, MATLAB throws an error for the following code: x.y = 1; x.y.z = 2; Instead, you can assign a field to a new variable: a = 1; c.b = 2 You also can use the a = 1; a = struct('b',2) |
Invoke anonymous functions with implicit variables in the function body or argument list or implicit calls to nested functions | Errors | Use only explicit variables when constructing anonymous functions. Implicit variables and function calls are often
encountered in the functions such as | If an anonymous function accesses any variable or nested function that is not explicitly referenced in the argument list or body, MATLAB throws an error when you invoke the function. For example, f = @() eval(‘x'); If an anonymous function references implicit variables or nested functions and is saved in an earlier version of MATLAB, it returns an error in MATLAB 8.6 and later. |
Call .p files generated prior to MATLAB 7.5 (R2007b) | Errors | None | Rebuild any P-code files generated with MATLAB 7.4 or earlier using a more recent version of MATLAB. |
| Errors | Replace all instances
of | |
| Errors | Replace all instances
of |
clear classes
command, useful
when reloading revised Python classesYou can modify a Python module that is already loaded into MATLAB,
using the MATLAB clear
function and the Python importlib.import_module
and reload
functions.
For an example, see Reload
Modified User-Defined Python Module.
To pass a Python function to a Python function, use
the function handle @
symbol. For an example, see Pass
Python Function to Python map Function.
MATLAB displays the class name of a Python error, which provides more information about the error. See Troubleshooting Error Messages.
You can connect the MATLAB Engine for Python to a MATLAB session that is already running. For an example, see Connect Python to Running MATLAB Session.
You can use the MinGW-w64 version 4.9.2 compiler from TDM-GCC to build MEX files and standalone MATLAB engine and MAT-file applications. For more information, see Install MinGW-w64 Compiler.
For an up-to-date list of supported compilers, see the Supported and Compatible Compilers website.
MATLAB R2015b supports the Intel Fortran Composer XE 2013 compiler with Microsoft Visual Studio 2013 Professional (64-bit) for building MEX files and MATLAB engine applications.
MATLAB no longer supports the GNU gfortran compiler for building MEX files and MATLAB engine applications on Apple Mac platforms.
Support for these compilers will be discontinued in a future release, at which time new versions will be supported.
Microsoft Visual Studio 2008 SP1 and Microsoft Platform SDK version 6.1
Apple Xcode 5.1
For an up-to-date list of supported compilers, see the Supported and Compatible Compilers Web page.
MATLAB now displays the warning stack when a MEX file displays
a warning. You can control the information displayed or suppressed
by calling the warning
function
with the backtrace
mode option before calling the
MEX file.
As of R2015b, the TAPPlugin
includes diagnostic
information in the Test Anything Protocol (TAP) stream. For more
information, see matlab.unittest.plugins.TAPPlugin
.
You can add the XMLPlugin
to the test runner
to produce a JUnit-style XML file. Use the output file to integrate
test results with continuous integration systems like Jenkins or TeamCity.
For more information, see matlab.unittest.plugins.XMLPlugin
.
Write plugins that immediately report when the test runner finalizes
a test result. A test result is final when no remaining test content
can modify the results. Examples of when the test runner might modify
previously run test results include when it executes code inside of TestClassTeardown
methods,
or when it tears down shared test fixtures. For more information,
see the reportFinalizedResult
method
of TestRunnerPlugin
and Plugin
to Generate Custom Test Output Format.
Write plugins that perform system-wide qualifications of a test
suite with the QualifyingPlugin
interface. For more
information, see matlab.unittest.plugins.QualifyingPlugin
.
runtests
function with the UseParallel
optionRun a suite of tests in parallel using the runtests
function
and the Parallel Computing Toolbox™. For more information, see
the 'UseParallel'
name-value pair argument of runtests
.
FailOnWarningsPlugin
Add the FailOnWarningsPlugin
plugin to the test
runner to produce a qualification failure when a test issues a warning.
For more information, see matlab.unittest.plugins.FailOnWarningsPlugin
.
TestCase
for specified class You can create a test case to use and debug your test class
interactively using the TestCase.forInteractiveUse
method.
This method accepts a meta.class
instance that describes
a TestCase
subclass. For more information, see matlab.unittest.TestCase.forInteractiveUse
.
You should no longer call the constructor of a TestCase
subclass
to use the instance interactively. Instead, pass the meta.class
instance
into the forInteractiveUse
method. For example, instead
of creating a test case using the constructor of MyTestCase
:
tc = MyTestCase;
create a test case using the forInteractiveUse
method:
tc = matlab.unittest.TestCase.forInteractiveUse(?MyTestCase);
CodeCoveragePlugin
Create a CodeCoveragePlugin
that reports on source
code contained within subfolders of the specified folders and subpackages
of the specified packages. For more information, see matlab.unittest.plugins.CodeCoveragePlugin
.
runtests
You can use the runtests
function to specify
the name of a test suite element. For example, runtests('ATestFile/aTest')
.
The runtests
function combines test suite element
names with test files, test classes, packages, or folders to build
and run your test suite. For more information, see runtests
.
Throws
constraintAs of R2015b, you can use the 'RespectingSet'
name-value
pair argument in the Throws
constraint to validate
that the invocation of a function handle throws an exception with
only a specified list of expected causes. The 'RespectingSet'
name-value
pair argument has a default value of false
. To
create a Throws
constraint that is not satisfied if
the expected exceptions contain causes that are not specified in the 'CausedBy'
name-value
pair, set 'RespectingSet'
to true
.
For more information, see matlab.unittest.constraints.Throws
.
Methods must be on the MATLAB path when called. For example, if you create an object and then change your current folder to a folder from which the method file is not visible, MATLAB returns an error when you call that method.
Before MATLAB release R2015b, after you create an object, you could call a method of that object even if the method definition was no longer on the MATLAB path. With release R2015b, methods must be on the MATLAB path when called.
numArgumentsFromSubscript
Function: Return number of arguments for customized indexing methodsIf your class overloads numArgumentsFromSubscript
, MATLAB calls
this method instead of numel
to determine the
number of array elements involved in an indexing operation when the
number of elements is greater than one.
If your class overloads numel
, MATLAB still
calls your overloaded numel
method.
subsref
and subsasgn
Functions: Compute number of arguments correctly Before MATLAB release R2015b, MATLAB incorrectly computed
the number of arguments expected for outputs from subsref
and
inputs to subsasgn
for some indexing expressions
that return or assign to a comma-separated list.
With release R2015b, MATLAB correctly computes the values
of nargout
and nargin
according
to the number of arguments required by the indexing expression. For
more information, see Modify
nargout and nargin for Indexing Methods.
subsasgn
Function: Call only with output argument The subsasgn
function
no longer supports a no output argument syntax that modifies the input
argument.
Before MATLAB release R2015b, subsasgn
modified
the input argument when you did not specify an output argument. With
release R2015b, you must assign an output argument or MATLAB returns
an error:
Error using subsasgn SUBSASGN must be called with an output.
display
Function: Use new argument to display nameThe display
function
supports a second input argument Use this argument to specify the
character array to display instead of the variable name.
javaArray
function to create zero length arrays MATLAB supports passing 0-length Java arrays to Java functions.
To create such an array, use the javaArray
function.
Before MATLAB release R2015b, MATLAB converted 0-length Java arrays
to null
.
javaaddpath
and javarmpath
The javaaddpath
and javarmpath
functions
clear the definitions of all Java classes defined by files on
the dynamic class path. As of MATLAB release R2015a, the functions
do not use the clear
java
command,
which also deletes global variables and variables from the MATLAB base
workspace, and removes all compiled scripts, functions, and MEX functions
from memory.
System.Object[,]
arrays to MATLAB types using the cell
functionUse this cell
function syntax to convert System.DateTime
and System.String
data
to cell arrays of MATLAB data,
A = cell(obj,'ConvertTypes',type)
where obj
is a .NET System.Object[,]
array,
and type
is one of the following strings:
{'System.DateTime'}
— Convert System.DateTime
elements
to MATLAB datetime
elements.
{'System.String'}
— Convert System.String
elements
to MATLAB strings.
{'all'}
— Convert all supported
.NET types to equivalent MATLAB types.
A
is a cell array, that is the same size
as the obj
array.
For an example, see Read Cell Arrays of Excel Spreadsheet Data.
In a file under source control in MATLAB, you can select any pair of file revisions to compare. Also, you can sort revisions by column headers in the Compare to Revision dialog box (for example, by date, revision number, or author). The Compare to Revision dialog box has an improved layout that places revision columns above the details pane, making it much easier to read.
Previously you could compare a revision only with your local file, which made investigation of older changes more difficult. You could not compare between other revisions, and you could not sort revisions.
For details, see Review Changes in Source Control.
There are two additional wall-clock options for measuring time
while profiling your code. The 'performance'
timer
uses the wall-clock time from the clock that the operating system
uses to measure performance. As of R2015b, this option is the default
timer for profiling. The 'processor'
timer uses
the wall-clock time directly from the processor. For more information,
type help profile
at the command prompt.
As of R2015b, the default timer is 'performance'
.
In previous versions of MATLAB, the default profiler timer was 'cpu'
,
which measures compute time instead of wall-clock time. You may notice
differences in the reported times from previous versions of MATLAB.
Also, depending on the code you are profiling, the summary of results
can appear different.
system
, dos
, and !
commands: Run Windows commands without running automatic Microsoft environment
commands On Windows platforms, the MATLAB system
, dos
,
and !
commands add the /D
flag
to the startup of the Windows Command Processor (cmd.exe
)
program. The /D
flag disables the running of these
AutoRun strings in Windows registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command
Processor
HKEY_CURRENT_USER\Software\Microsoft\Command
Processor
To preserve the behavior of previous releases, prepend cmd
/C
to your operating system command. For example, in MATLAB,
the command,
!cmd /C "cd"
calls the cd
command using the AutoRun values.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Errors | Replace all instances of creating
a Use the When you run tests in the unit testing framework, the test runner creates the instances. | |
| Errors | No replacement required | If changes to a class definition result in an incompatibility that MATLAB cannot resolve with existing objects of that class, MATLAB returns an error. In previous releases, MATLAB converted
those objects to object of the |
Built-in support for the Microsoft Source Code Control
Interface, including | Warns | None | MATLAB no longer includes built-in support for the Microsoft Source Code Control Interface (MSSCCI). Replace this functionality with one of these options:
|
| Warns | None | Replace this functionality with one of these:
|
| Still runs | None | R2015b is the last release supporting custom COM interfaces
( |
graph
and digraph
Classes: Create, analyze, and visualize graphs and networksAfter creating a graph object, there are numerous functions available for modifying the graph, analyzing its properties, applying search algorithms, and visualizing the structure. For more information, see Graph and Network Algorithms.
histcounts2
Function: Bin bivariate dataThe histcounts2
function
sorts bivariate data into 2-D bins with data dependent bin picking
and options for bin control and normalization.
deg2rad
and rad2deg
Functions: Convert between radians and degreesdatetime
Arrays: Interpolate dates and times using interp1
functionThe interp1
function
accepts datetime
arrays as an input argument.
duration
Arrays: Perform computations on durations using interp1
, eps
, cummax
, cummin
, cumsum
, mod
,
and rem
functionsexpm
, logm
, and sqrtm
Functions: Algorithm upgradeshistcounts
Function: Use categorical array inputsThe histcounts
function
accepts categorical arrays as an input argument.
xlsread
, xlswrite
, readtable
,
and writetable
functionsRepeated calls to the xlsread
, xlswrite
, readtable
,
and writetable
functions
show significant performance improvement.
datastore
Function: Import data from image collections that are too large to fit in memory as an ImageDatastore
Use the datastore
function to create an ImageDatastore
,
which can import data from image collections that are too large to
fit in memory.
ImageDatastore
is a compatible datastore
for use with mapreduce
.
datastore
Function: Import data from text files with support for additional character encoding schemes with TabularTextDatastore
In addition to UTF-8 and US-ASCII, TabularTextDatastore
now
supports all of the character encoding schemes that the fopen
function
supports, such as, ISO-8859-1, windows-1251, and Shift_JIS. For additional
supported encoding schemes, see TabularTextDatastore
Properties.
Files
property Now when modifying the Files
property of
an existing datastore, each string in the input cell array of strings
must contain a full path to the file. Previously, the input cell array
could contain folder names or strings with wildcard (*
)
characters to represent multiple files.
The Files
property for all file-based datastores
is now a column vector. Previously, the Files
property
was a row vector.
Although modifying the Files
property of
an existing datastore requires full paths to the files, this change
does not affect the creation of a datastore using the datastore
function.
When creating a new datastore using the datastore
function,
you can specify the location of the files or folders as a single string
or a cell array of strings in the form of a column or row vector.
The strings also can contain wildcard characters to represent multiple
files.
VideoReader
Object: Read streams of data more quickly from video files on MacVideoReader
now
reads MPEG-4 and MOV video files more quickly on Mac OS.
readtable
and writetable
Functions: Specify locale for dates in tablesYou can specify the locale that the readtable
and writetable
functions
use for month and day names. Specify the DateLocale
name-value
pair argument to read month and day names from text files, or to write
month and day names to text files or spreadsheets.
Library | Version |
---|---|
NetCDF | 4.3.3.1 (upgraded from 4.1.3) |
The upgrade to the NetCDF library version 4.3.3.1 brings these enhancements:
Many bug fixes in the library
Fixes for older OPeNDAP servers that do not conform to DAP 2.0 protocol
The fopen
function
now supports additional character encoding schemes, including EUC-KR,
GB2312, GB18030, and KOI8-R. After you call fopen
,
subsequent read and write operations such as fscanf
, fprintf
, fread
,
and fwrite
use the specified character encoding.
webread
, websave
, and webwrite
Functions: Use datetime
objects as query parametersThe webread
, websave
,
and webwrite
functions
can accept input arguments specified as datetime
objects
for requests to web services that accept dates and times as query
parameters. To match the date and time format required by the web
service you call, specify the Format
property of
a datetime
object.
webread
, websave
, and webwrite
Functions: Specify array format for query parameters that represent multiple
valuesTo specify the array format for query parameters that represent
multiple values, specify the ArrayFormat
property
of a weboptions
object.
Pass the query parameters and the weboptions
object
as input arguments to the webread
, websave
,
or webwrite
functions.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Errors | Replace all instances of | |
| Errors | Replace all instances of | |
| Errors | audiowrite | Write audio files using |
| Errors | Replace all instances of | |
| Errors | Replace all instances of | |
| Errors | Replace all instances of | |
| Warns | VideoWriter | Remove all instances of movie2avi . Write
to AVI files with VideoWriter . |
| Still runs |
| Use name-value name 'Type' instead of 'DatastoreType' . |
| Warns |
| Replace all instances of |
| Warns |
| Replace all instances of |
Folders and wildcard ( | Warns | A string or cell array of strings where each string represents a full path to the file | Replace all folder names or wildcard characters with
full path and file names when assigning to the |
hdfgd | Warns | matlab.io.hdfeos.gd | Replace all instances of hdfgd with the
corresponding function in the matlab.io.hdfeos.gd package. |
hdfsd | Warns | matlab.io.hdf4.sd | Replace all instances of hdfsd with the
corresponding function in the matlab.io.hdf4.sd package. |
hdfsw | Warns | matlab.io.hdfeos.sw | Replace all instances of hdfsw with the
corresponding function in the matlab.io.hdfeos.sw package. |
The appearance of graphics is improved for these system configurations:
Macintosh systems with Apple Retina displays
Windows systems in which the DPI (dots-per-inch) value is higher than 96
Previously, MATLAB allowed the operating system to scale graphical elements on these high-DPI systems. That scaling helped to maintain consistent appearance and functionality, but it also introduced undesirable effects. Graphical elements often looked blurry, and the size of those elements was sometimes inconsistent.
Instead of relying on the operating system, MATLAB is now DPI-aware, which means that it takes advantage of the full system resolution to draw graphical elements (fonts, UIs, and graphics). Thus, graphical elements appear sharp and appropriately scaled regardless of your display DPI. For more information, see DPI-Aware Behavior in MATLAB.
In order to display graphics at an appropriate scale,
distances in pixels are now device-independent on Windows and Macintosh systems.
If you set the Units
property or FontUnits
property
of an object to 'pixels'
, the size of each pixel
is as follows:
Windows systems — 1 pixel is 1/96 inch.
Macintosh systems — 1 pixel is 1/72 inch.
Linux systems — No change. Pixel size determined by display DPI.
In most cases, you do not need to modify your code.
Keep in mind that specifying the size and location of graphics components
in pixels might not correspond to the actual pixels on your screen.
For example, when the Units
property of a figure
is set to 'pixels'
, MATLAB reports the Position
and CurrentPoint
property
values based on device-independent pixels, not the size of the actual
pixels on the screen.
MATLAB might report the size and location of
objects as fractional values (in pixel units) more frequently than
in previous releases. For example, your code might report fractional
values in the Position
property of a figure,
whereas previous releases reported whole numbers for that same figure.
The ScreenSize
property of the root object
might not match the display size reported by high-DPI Windows systems.
Specifically, the values do not match when the Units
property
of the root object is set to 'pixels'
. MATLAB reports
the value of the ScreenSize
property based on device-independent
pixels, not the size of the actual pixels on the screen.
When using getframe
(or print
with
the -r0
option) on a high-DPI system, the size
of image data array that MATLAB returns is larger than in previous
releases. Additionally, the number of elements in the array might
not match the figure size in pixel units. MATLAB reports the
figure size based on device-independent pixels. However, MATLAB bases
the size of the image array on the display DPI value.
The ScreenPixelsPerInch
property of the root
object is now read only, and the value depends on the system:
Windows systems — The value is 96 DPI.
Macintosh systems — The value is 72 DPI.
Linux systems — The value is determined by your display DPI.
Also, you cannot set or query the default value of
the ScreenPixelsPerInch
property. These commands
now return an error:
get(groot,'DefaultRootScreenPixelsPerInch') set(groot,'DefaultRootScreenPixelsPerInch')
get(groot,'FactoryRootScreenPixelsPerInch')
Axes objects now have an 'origin'
option
for the XAxisLocation
and YAxisLocation
properties.
Use this option to display the x-axis or y-axis
so that it passes through the origin point (0,0)
.
These properties only affect 2-D views of the axes.
Numeric rulers are new objects that you can use to modify the
appearance or behavior of the x-axis, y-axis,
or z-axis. When you create an axes object, MATLAB creates
a numeric ruler for each individual axis. Modify a particular axis
by setting properties of the associated numeric ruler. Access the
number ruler through the new XAxis
, YAxis
,
or ZAxis
property
of the axes object.
Numeric rulers have several properties that offer new types
of axis customizations. Control the format of the tick labels using
the TickLabelFormat
property. For example,
you can display the tick labels as currency values or control the
number of decimal places displayed. Additionally, you can control
if the tick labels use exponential notation with the Exponent
property.
For a list of properties, see Numeric Ruler Properties.
histogram2
Function: Plot bivariate histograms with control over bins, normalization, and displayThe histogram2
function
plots bivariate histograms with data-dependent bin picking and options
for bin control, normalization, and visualization.
When you specify an output argument with the histogram2
function,
it returns an object that you can use to modify properties of the
histogram. For example, you can change the number of bins in each
dimension, use a different binning algorithm, or normalize the histogram
in several ways. For more information, see Using histogram2
Objects.
histogram
Function: Use categorical array inputsThe histogram
function
accepts categorical arrays as an input argument.
histogram
objects created using categorical
data contain some different properties than normal numeric histograms.
For more information, see Histogram
Properties.
histogram
and histogram2
Functions: Interactively manipulate histograms with context menuHistogram plots created using either histogram
or histogram2
have
a context menu in plot edit mode that enables interactive manipulations
in the figure window.
Area, bar series, and scatter series objects now support transparency. This table lists the new transparency properties for each object. Set these properties to a value between 0 (transparent) and 1 (opaque).
Object | New Properties |
---|---|
Area | FaceAlpha EdgeAlpha |
Bar series | FaceAlpha EdgeAlpha |
Scatter series | MarkerFaceAlpha MarkerEdgeAlpha |
Alternatively, you now can use the alpha
function
to change the transparency of these objects. Specify the input to alpha
as
a value between 0 and 1, 'opaque'
, or 'clear'
to
affect these objects.
Control the appearance of contour labels by setting text properties
with any clabel
syntax. In R2014b and R2015a, not
all clabel
syntaxes supported name-value pairs
to set text properties.
The changes to clabel
are as follows:
All syntaxes now support name-value pairs to set a useful subset of text properties.
Syntaxes that previously supported name-value pairs to set text properties now support only a subset of text properties.
For the list of supported properties, see clabel
.
There are some text properties that you can no longer set using clabel
.
For example, you cannot set the Parent
, Children
,
or UserData
properties as name-value pairs. All
the syntaxes that are more restrictive in terms of supported text
properties continue to return text objects. If necessary, you can
use those text objects to set additional properties.
The opengl
function
now supports the hardwarebasic
option. This option
uses your graphics hardware, but disables these graphics features
that are unstable with some graphics drivers:
Align vertex centers feature for sharp vertical and horizontal lines
Depth peel transparency feature for accurate transparency in overlapping 3-D objects
The disabled features might change in future releases as graphics features change and graphics hardware evolves.
Chart lines and primitive lines have a LineJoin
property
for controlling the style of the line corners. Options include round,
chamfer, and miter styles.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
plotmatrix function | Still runs | Not applicable | plotmatrix now returns histogram objects
instead of patch objects in its fourth output argument. Use histogram
properties instead of patch properties to modify the appearance of
the histogram plots. For a list, see Histogram
Properties. |
| Errors | None | MATLAB no longer ships with the Ghostscript® library.
Remove all instances of code that use |
The appearance of UIs have improved for the following high-DPI systems:
Macintosh systems with Apple Retina displays
Windows systems in which the DPI (dots-per-inch) value is higher than 96
These are the visual improvements you might see:
UI components look sharp and render with full graphical detail.
When you create a UI object, and specify the Units
as 'pixels'
,
the size of that object is now consistent with the size of other objects.
For example, the size of a push button (specified in pixels) is now
consistent with the size of the text on that push button (specified
in points).
For more information about the new DPI-aware behavior, see DPI-Aware Behavior in MATLAB.
In order to display UI components at an appropriate
scale, distances in pixels are now device-independent on Windows and Macintosh systems.
If you set the Units
property or FontUnits
property
of an object to 'pixels'
, the size of each pixel
is as follows:
Windows systems — 1 pixel = 1/96 inch
Macintosh systems — 1 pixel = 1/72 inch
Linux systems — No change. The size of a pixel is determined by the display DPI.
In most cases, you do not need to modify your code.
Keep in mind that specifying the size and location of UI components
in pixels might not correspond to the actual pixels on your screen.
For example, when the Units
property of a figure
is set to 'pixels'
, MATLAB reports the Position
and CurrentPoint
property
values based on device-independent pixels, not the size of the actual
pixels on the screen.
MATLAB might report the size and location of
objects as fractional values (in pixel units) more frequently than
in previous releases. For example, your code might report fractional
values in the Position
property of a figure,
whereas previous releases reported whole numbers for that same figure.
The ScreenSize
property of the root object
might not match the display size reported by high-DPI Windows systems.
Specifically, the values do not match when the Units
property
of the root object is set to 'pixels'
. MATLAB reports
the value of the ScreenSize
property based on device-independent
pixels, not the size of the actual pixels on the screen.
UIs might appear larger than in previous releases on Windows systems in which the display scaling value is greater than 100% but less (or equal to) than 125%. Also, icons in those UIs might look slightly blurry because they are enlarged to accommodate the larger UI. To avoid these effects, set the Windows DPI scaling to 100%.
For a list of related changes in Graphics, see Graphics Display: Leverage DPI-aware MATLAB graphics for Apple Retina displays and high-resolution displays on Windows.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
menu | Still runs | dialog | The menu function is not recommended. Use the dialog function
to create multiple choice dialog boxes. |
The new MATLAB execution engine includes performance improvements to function calls, object-oriented operations, and many other MATLAB operations.
These performance improvements result in significantly faster execution of many MATLAB programs with an average speed-up of 40% among 76 performance-sensitive applications from users. Of these tested applications, 13 ran at least twice as fast and only 1 slowed down by more than 10%.
The new execution engine uses just-in-time compilation of all MATLAB code which makes performance more uniform and predictable. The new engine offers improved quality and provides a platform for future performance optimizations and language enhancements.
table
Data Type: Access data with improved performance when using dot-parenthesesUsing dot-parentheses indexing to access elements of a table
variable, for example x = T.V(I)
, has better performance.
A categorical array can contain a larger number of categories.
Categorical arrays with small numbers of categories use memory more efficiently.
Some categorical comparison and assignment operations involving scalars are faster.
You can use the MATLAB Support Package for Raspberry Pi Hardware with Raspberry Pi 2 Model B hardware.
You can use MATLAB commands to connect to a BeagleBone Black board over a network. For more information, see MATLAB Support Package for BeagleBone Black Hardware.
The MATLAB Support Package for Apple iOS Sensors enables you to collect sensor data from your Apple iOS mobile 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 these sensors:
Acceleration
Angular Velocity
Orientation
Magnetic Field
Position
The Apple iOS sensors product requires:
Installation of MATLAB Mobile™ on your Apple iOS device. You can acquire this application through the App Store.
Your Apple device must use iOS version 7 or later.
MATLAB version R2015a or later, for creating the connection to the application and logging sensor data.
Installation of the MATLAB Support Package for Apple iOS Sensors.
The support package includes the command-line interface in MATLAB and
the ability to interact with Apple iOS sensors, which is a separate
tab in MATLAB Mobile. To connect to sensors on the phone and collect
data, you create a mobiledev
object in MATLAB.
You make the connection between your computer running MATLAB and
the phone via Wi-Fi® or your cellular network. To get started,
see Get
Started with Apple iOS Sensors.
When you create custom help and add it to the MathWorks documentation, the help link appears on the Home Help page. For instance, if you add the sample Upslope Area Toolbox documentation, it appears as shown here.
When you click the link for your custom help, that help displays in the current window.
Previously, to access custom help that you added to MathWorks help, you clicked a Supplemental Software link at the bottom of the help home page. Then that help opened in a separate window.
For more information on the Upslope Area Toolbox sample and
creating custom documentation, see builddocsearchdb
and Display
Custom Documentation.
New documentation reference pages for MathWorks products include an annotation at the bottom of the page. The annotation indicates the release in which the feature was introduced. For example, "Introduced in R2015a." (Some reference pages for features introduced before R2015a also include the release information.)
MATLAB limits the amount of computer memory used to allocate
memory for each mxArray
. To adjust or remove this
limit, use the MATLAB array size limit preference
described in Workspace
Browser Preferences.
When editing class definition files in the Editor, you can press the Tab key to complete the names of class properties and methods. For more information, see Tab Completion.
For computers in Japanese, Chinese, or Korean locales, you can choose to run MATLAB with an English user interface rather than in the localized language. Desktop items (such as dialog boxes, button names, and menu items) and error and warning messages will appear in English. For information about setting this option, see General Preferences.
repelem
Function: Repeat copies of array elements to create a larger arrayThe repelem
function
copies elements of an array into a new array according to a specified
repetition scheme.
sort
Function: Now preserves shape of cell array of string inputs The sort
function
now preserves the shape of input cell arrays of strings and sorts
each column independently. This makes the behavior for sort
with
a cell array of strings consistent with the behavior of sort
with
a numeric array.
Previously, sort
flattened all cell array
of string inputs into a vector output. This behavior treated the input
cell array as a tall vector of strings, and did not preserve the size
of the input. Any code that relies on the output size of sort
on
a cell array of strings might need to be updated.
To continue using the previous behavior, use the colon operator, :
,
when calling sort
on a cell array, for example, sort(X(:))
.
isenum
Function: Determine if variable is enumerationThe isenum
function
tests the input argument to determine if it is an enumeration.
milliseconds
Function: Convert duration to number of millisecondsThe milliseconds
function
converts duration
values to double
values
in units of milliseconds.
External file content can be added into MATLAB published
code using the new <include>
markup. For
information about this new markup, see External
File Content.
fullfile
Function: Maintain all double-dot symbols The fullfile
function
now maintains all double-dot symbols in the input file parts. This
behavior is consistent with the treatment of double-dot symbols in
R2012b and earlier.
In R2013a through R2014b, fullfile
collapsed
inner relative directories indicated by double-dot (..) symbols and
returned an equivalent full file path specification that did not display
the symbols. The double-dot symbols were maintained only if they appeared
at either end of the full file path specification.
For example, the commands,
f = fullfile('C:\foo\folder1\..\folder2') h = fullfile('\\folder4\.')
f = C:\foo\folder1\..\folder2 h = \\folder4\.
f = C:\foo\folder2 h = \\folder4\.
Change code that relies on resolving double-dot symbols in a full file path.
MATLAB supports the following versions of CPython:
Version 2.7
Version 3.3
Version 3.4
For more information, see Install Supported Python Implementation.
The engine function matlab.engine.start_matlab
supports MATLAB startup
options. In addition, the engine supports '-desktop'
to
launch MATLAB with the desktop.
From Python 2.7 you can pass variables of data type unicode
as
input arguments to MATLAB functions. The engine can return unicode
output
arguments to Python 2.7.
In previous versions of MATLAB, the Java string was terminated at the first null.
When you communicate with web services using web services description language (WSDL) documents, errors can occur if a WSDL file imports another WSDL file that uses the WSDL import element. For more information, see Limitations to WSDL Document Support.
You can use tags to group tests into categories, and then run
tests with specified tags. Tag your tests using the class-level or
method-level TestTags
attribute on TestCase
.
Select tagged test elements using the HasTag
selector
or the 'Tag'
name-value pair on one of the following TestSuite
methods: fromClass
, fromFile
, fromFolder
, fromMethod
, fromPackage
,
or selectIf
.
You also can select and run tagged tests using the 'Tag'
name-value
pair with the runtests
function.
For more information, see Tag Unit
Tests.
You can run a suite of tests in parallel using the Parallel Computing Toolbox.
For more information, see the runInParallel
method
of the TestRunner
class.
You can include a shared variables section in your script-based test file. In this section you can define variables to share between tests in the script and define any critical preconditions necessary for your tests. For more information, see http://www.mathworks.com/help/releases/R2015a/matlab/matlab_prog/write-script-based-unit-tests.html.
You can manually configure your test environment, and the test
runner does not need to perform shared fixture setup and teardown
activities. To define prebuilt fixtures, use the PrebuiltFixtures
property
on the TestRunner
instance in combination with the SharedTestFixtures
attribute
of the TestCase
class. In certain testing scenarios,
prebuilding fixtures can result in significant time or resource savings.
An example where prebuilt test fixtures might be a benefit is a test
that meets these three conditions:
Has shared fixtures that are expensive to set up
Has a required fixture state that can be set up manually in the MATLAB session
Does not require a fresh test fixture for each test run
For more information, see matlab.unittest.TestRunner
.
isequaln
When the class of the expected value defines an isequaln
method,
the ObjectComparator
uses that method for object comparison.
In previous releases, ObjectComparator
used isequal
to
compare all objects. The IsEqualTo
constraint and the assertEqual
, assumeEqual
, fatalAssertEqual
,
and verifyEqual
qualification methods leverage ObjectComparator
and,
therefore, inherit the same change in behavior. For more information,
see ObjectComparator
.
Rewrite your tests to force a comparison with isequal
when
you use ObjectComparator
to compare objects of
a class that defines isequaln
and you rely on the
results of isequal
instead of isequaln
.
For example, if the class of expObj
defines isequaln
,
then testCase.verifyEqual(actObj,expObj)
uses isequaln
for
comparison, but testCase.verifyReturnsTrue(@()isequal(actObj,expObj))
uses isequal
.
Similarly, testCase.verifyThat(actObj,IsEqualTo(expObj))
uses isequaln
for
comparison, but testCase.verifyThat(@()isequal(actObj,expObj),ReturnsTrue)
uses isequal
.
Throws
constraint When you specify expected causes using the 'CausedBy'
name-value
pair argument in the Throws
constraint, the causes
must be a cell array of strings or an array of meta.class
instances.
In previous releases, you specified the value of 'CausedBy'
as
a cell array that could contain both strings and meta.class
instances.
For more information, see matlab.unittest.constraints.Throws
.
Rewrite tests that use the Throws
constraint
and specify heterogeneous data types for 'CausedBy'
.
If you cannot define expected causes using either a cell array of
strings or an array of meta.class
instances, consider
performing the qualification using two separate Throws
constraints.
When using the Git source control integration, you can view branch details and delete branches in the Manage Branches dialog box. Use the Branch Browser to see which files changed for a particular commit in the branch or to view the author, date, and commit message.
For more information, see Branch and Merge with Git.
The new functions mxCreateUninitNumericMatrix
and mxCreateUninitNumericArray
create
numeric arrays without initializing the data elements. If you want
to initialize the data elements, use the functions mxCreateNumericMatrix
and mxCreateNumericArray
.
To convert an mxArray
to a C-style string
in UTF-8 encoding, call the new mxArrayToUTF8String
function.
To determine if an mxArray
contains scalar
data, call the new mxIsScalar
function.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Errors | none | Refactor any code that uses |
| Warns | Replace all instances of creating
a Use the When you run tests in the unit testing framework, the test runner creates the instances. | |
| Still runs | Source control action through context menu | Access source control actions through
the context menu instead of using |
| Still runs | Click the Preferences button on the Home tab, and select General > Source Control. | View the currently selected source
control system through Preferences instead
of using |
| Still runs | none | Replace this functionality with one of the following options.
|
discretize
Function: Group numeric data into bins or categoriesThe discretize
function
groups numeric data into bins. By default the bins are numeric, and discretize
returns
indices describing the bin placement of each element. However, the
bins also can be categories, in which case discretize
returns
a categorical array.
NaN
values in basic statistical calculations, including max
, min
, mean
, median
, sum
, var
, std
,
and cov
ismembertol
and uniquetol
Functions: Perform set comparisons using a toleranceThe ismembertol
and uniquetol
functions
perform set operations using a tolerance. These functions are useful
in situations where floating-point round-off errors occur in calculations.
The dSFMT random number generator algorithm provides a faster implementation of the Mersenne Twister algorithm. For more information about available random number generator algorithms, see Creating and Controlling a Random Number Stream.
nearestNeighbor
Function: Determine nearest alphaShape
boundary pointThe nearestNeighbor
function
for alphaShape
determines
the nearest boundary point on the alpha shape for a specified query
point.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Errors | Replace all instances
of |
'file'
option for ReadSize
propertyThe ReadSize
property for TabularTextDatastore
objects
now accepts the string value, 'file'
. This option
reads one complete text file at a time. For more information, see TabularTextDatastore
Properties.
partition
function using Parallel Computing ToolboxThe partition
function
partitions a datastore into a number of parts. You then can specify
a subset of the datastore to read. If you have Parallel Computing Toolbox installed,
you can read datastore parts in parallel without using MapReduce.
webwrite
Function: Send data to RESTful Web services using HTTP POST methodThe webwrite
function
sends data to RESTful Web services using an HTTP POST request.
webread
and websave
Functions: Request data from RESTful Web services using HTTP POST methodxlsread
and readtable
Functions: Read larger spreadsheet files from Excel softwaretextscan
and readtable
Functions: Return consistent results when reading quoted strings As of R2014b, using the %q
format specifier
with the textscan
and readtable
functions
returns consistent results. When using %q
to read
strings that begin with a double quotation mark ("
), textscan
and readtable
remove
the leading double quotation mark and its accompanying closing mark.
The closing mark is the second instance of a lone, unescaped double
quotation mark. The functions replace escaped double quotation marks
(for example, ""abc""
) with lone double quotation
marks ("abc"
). The textscan
and readtable
functions
ignore any double quotation marks that follow the closing mark.
In R2014a and earlier, the textscan
and readtable
functions
return unpredictable results when reading strings with extraneous
double quotation marks. This behavior can occur when you use the %q
format
specifier or if you do not specify a value for the Format
name-value
pair argument to readtable
.
For example, these commands:
C = textscan('"Alvin ""Al"" Smith"','%q','Delimiter',','); C1 = C{:} D = textscan('"Alvin" "Al" Smith"','%q','Delimiter',','); D1 = D{:} E = textscan('"Alvin ""Al"" Smith" and Brian"""Jones','%q','Delimiter',','); E1 = E{:}
C1 = 'Alvin "Al" Smith' D1 = 'Alvin "Al" Smith"' E1 = 'Alvin "Al" Smith and Brian"""Jones'
In R2014a and earlier, the same commands return:
C1 = 'Alvin "Al" Smith' D1 = 'Alvin "Al Smith"' E1 = 'Alvin "Al" Smith and Brian""Jones'
Code that relies on using the %q
format specifier
to read text enclosed in double quotation marks might return different
results. Such code includes calls to readtable
that
do not specify a value for the Format
name-value
pair argument. However, there is no behavior change when reading strings
with proper double quotation marks.
This table lists upgrades to scientific file format libraries used by MATLAB.
Library | Version |
---|---|
HDF5 | 1.8.12 (upgraded from 1.8.6) |
The H5Pset_dxpl_multi
and H5Pget_dxpl_multi
routines
were removed from the HDF5 Library as of version 1.8.11. As a result,
the H5P.set_dxpl_multi
and H5P.get_dxpl_multi
functions
in MATLAB now return an error. Remove instances of H5P.set_dxpl_multi
and H5P.get_dxpl_multi
from
your code.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Still Runs |
| Replace all instances of |
| Still Runs |
| Replace all instances of |
urlread for HTTP POST requests | Still runs | webread webwrite | Use webread for reading content with an
HTTP POST request. Use webwrite for sending data
with an HTTP POST request. |
| Errors | none | Remove all instances of |
| Errors | none | Remove all instances of |
drawnow
Function: Improve performance in animation loops with new optiondrawnow
now
supports the limitrate
option for limiting the
number of figure updates to 20 frames per second. If you are updating
graphics objects in a loop and do not need to see every update on
the screen, you can use this option to skip some updates for a faster
animation.
Functionality | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
syntax | Still runs | drawnow limitrate | Replace all instances of drawnow update with drawnow
limitrate . |
syntax | Still runs | drawnow nocallbacks | Replace all instances of drawnow expose with drawnow
nocallbacks . |
mapreduce
algorithms on any computer cluster that supports parallel pools using MATLAB Distributed Computing ServerThe mapreduce
function
now runs on any cluster that supports a parallel pool.
For more information about mapreduce
execution
environments, see Speed
Up and Deploy MapReduce Using Other Products.
The griddedInterpolant
, interp1
, interp2
, interp3
,
and interpn
functions
show significant performance improvement by using multithreading in
large calculations.
You can use the MATLAB IP Camera support to bring live images into MATLAB Images can be from any IP Camera that supports Motion JPEG stream over HTTP or RTSP with basic authentication support. IP cameras, also referred to as netcams or network cameras, are increasingly popular in live image processing applications.
With simple MATLAB functions you can preview your image,
acquire single snapshots from the camera, and optionally set up a
loop of acquired images. The ipcam
function creates
the IP Camera object that is used to acquire images, and the snapshot
function
returns a single image from the camera.
IP Camera support is available only through a hardware support
package. Download and install the necessary files using the Support
Package Installer, which you open by typing supportPackageInstaller
in MATLAB.
On the Select support package to install screen,
select IP Cameras
from the list.
You can use MATLAB IP Camera support on the following platforms:
Microsoft Windows 32-bit and 64-bit
Mac OS X 64-bit
Linux
For more information about the IP camera support, see the MATLAB Support Package for IP Cameras documentation, which is available when you download the support package.
You can use MATLAB commands to connect to a BeagleBone Black board over a network and perform the following operations:
Exchange data with sensors and actuators that are connected to the ADC, GPIO, I2C, PWM, serial port, and SPI interfaces
Take photographs using a web camera
Issue Linux shell commands
Transfer files to or from your host computer
Control the onboard LED
Using the command-line interface in MATLAB, you can:
Start programing without additional toolboxes.
Interactively develop and debug programs in MATLAB.
Acquire and process sensor data in MATLAB in a variety of ways, including creating plots.
For more information, see MATLAB Support Package for BeagleBone Black Hardware.
You can now use these boards with MATLAB Support Package for Arduino Hardware:
Arduino Leonardo
Arduino Micro
Arduino Mega ADK
Arduino Nano 3.1
Sparkfun Redboard
Sparkfun Digital Sandbox
Sainsmart Uno
Sainsmart Mega 2560
In release R2015a, use configurePin
to set
your pin mode. You can use string values, such as ‘D2'
to
specify digital pins.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Warns | Replace all instances of | |
configureAnalogPin | Warns | configurePin | Replace all instances of configureAnalogPin with configurePin . |
configureDigitalPin | Warns | configurePin | Replace all instances of configureDigitalPin with configurePin . |
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.
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.
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.
For information about setting this option, see General Preferences.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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 PythonFor 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 For information about using matlab.wsdl.createWSDLClient
,
see Access
Services That Use WSDL Documents.
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.
createClassFromWsdl
, createSoapMessage
, callSoapService
,
and parseSoapResponse
will be removed in a future
release. Use matlab.wsdl.createWSDLClient
instead.
Graphics objects use object handles of various types instead of the numeric handles used in previous releases.
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.
classdef
files, including immediate impact on existing and new workspace variablesThis 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.
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.
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
.
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.
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.
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.
You can use the matlab.unittest.constraints.IsScalar
constraint
class to test that an actual value is a scalar.
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
.
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
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.
Change code that expects to remove all files and folders using a wildcard character, on Linux and Mac.
Functionality | Result | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Warns | Replace all instances
of RPC-encoded WSDL documents are not supported. | |
| Still runs | Replace all instances
of | |
| Still runs | Replace all instances of creating
a Use the When tests are run in the unit testing framework, instances are created by the test runner. | |
| Still runs | Replace all instances of To construct a plugin with the same level of
detail, use | |
| Errors | For MEX-files, replace all instances of |
histcounts
function for binning numeric dataThe 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 pointThe nearestNeighbor
function
identifies the closest vertex to a query point, and the pointLocation
function
identifies the enclosing triangle or tetrahedron for a query point.
'next'
and 'previous'
neighbors with the interp1
function and griddedInterpolant
classThe 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'
.
round
functionThe 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 pointsThe 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 arraycumsum
, cummin
, cummax
, and cumprod
functionsFunctionality | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
| Errors |
| Replace all instances of |
| Errors |
| Replace all instances of |
| Still Runs | histcounts function | Replace all instances of |
readtable
and textscan
functionscategorical
and datetime
arrays using the readtable
and textscan
functionsdatastore
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.
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
connectionsTCP, 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 datareadtable
functionThe readtable
function
can read text files with non-ASCII character encoding schemes. Use
the optional 'FileEncoding'
name-value pair argument
to specify the encoding.
writetable
functionThe 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 removedThe 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 | What Happens When You Use This Functionality? | Use This Instead | Compatibility Considerations |
---|---|---|---|
movie2avi | Still Runs | VideoWriter | Remove all instances of movie2avi . Write
to AVI files with VideoWriter . |
avifile | Errors | VideoWriter | Replace all instances of avifile with VideoWriter . |
aviread | Errors | VideoReader | Replace all instances of aviread with VideoReader . |
exifread | Errors | imfinfo | Replace all instances of exifread with imfinfo . |
urlread | Still runs | webread | Use webread only for reading content with
HTTP GET requests. To send data using HTTP POST, continue to use urlread . |
urlwrite | Still runs | websave | Replace all instances of urlwrite with websave . |
read method of VideoReader class | Still runs | readFrame method
of VideoReader class | Replace all instances of read with readFrame . |
NumberOfFrames property of VideoReader class | Still runs | none | Remove all instances of NumberOfFrames .
When reading a video file, use the CurrentTime property
to specify where reading should begin. |
hdfgd | Still runs | matlab.io.hdfeos.gd | Replace all instances of hdfgd with the
corresponding function in the matlab.io.hdfeos.gd package. |
hdfsd | Still runs | matlab.io.hdf4.sd | Replace all instances of hdfsd with the
corresponding function in the matlab.io.hdf4.sd package. |
hdfsw | Still runs | matlab.io.hdfeos.sw | Replace all instances of hdfsw with the
corresponding function in the matlab.io.hdfeos.sw package. |
Starting in R2014b, each hardware support package installs with its own documentation. See Supported Hardware for more information on support packages.
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.
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.
You can use MATLAB Support Package for LEGO® MINDSTORMS® EV3 Hardware on 32-bit and 64-bit Microsoft Windows systems, Mac OS, and Linux systems.
Use the LEGO MINDSTORMS EV3 hardware that connects to your system over a USB, Wi-Fi, or Bluetooth® connection to:
Get data from EV3 color, gyroscopic, infrared, ultrasonic, and touch sensors.
Get data from an EV3 Remote Infrared Beacon.
Control and get data from EV3 motors.
Interact with the LCD, status light, speaker, and buttons on the EV3 brick.
Using the command-line interface in MATLAB, you can:
Start programing without additional toolboxes.
Interactively develop and debug programs in MATLAB.
Acquire and process sensor data in MATLAB in a variety of ways, including creating plots.
Run control loops at up to 25 Hz (not in real time).
For more information, see MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware.
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.
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.
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?.
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.
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.
New axes properties support rotated axis tick labels. For more
information, see the XTickLabelRotation
, YTickLabelRotation
,
and ZTickLabelRotation
property
descriptions.
datetime
and duration
tick labels with plot
functionThe 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 histogramsThe 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 animationsThe animatedline
function
optimizes line animations by accumulating and plotting data from a
streaming data source.
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.
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.
categorical
data with automatic slice labelsPie charts support categorical
data and automatically
label the slices.
rgb2gray
and im2double
, no longer requiring Image Processing Toolboximshow
function for displaying images from matrices or files, no longer requiring Image Processing ToolboxMATLAB 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 filesSaving 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.
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.
Functionality | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
syntax | Still runs | hold on | Replace all instances of hold all with hold
on . |
hist function | Still runs | histogram function | Use histogram instead of hist . |
syntax | Still runs | colorbar(ax) | Replace all instances of colorbar('peer',ax) with colorbar(ax) . |
Using 0 to access the root object | Still runs | command | Use the groot command to access the root
object instead of 0 . |
EraseMode property for all graphics objects | Warns | Not applicable | Remove all instances of the EraseMode property.
For more information, see How
Do I Replace the EraseMode Property?. |
noanimate function | Warns | Not applicable | Remove all instances of the noanimate function.
For more information, see How
Do I Replace the EraseMode Property?. |
HitTestArea property for group, transform,
and chart objects | Errors | The PickableParts property | Remove 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 objects | Does not separate text | Use a cell array of strings, a padded string matrix, or numeric vectors | Replace 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 data | Warns or errors | Real valued input arguments | Charting 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 property | Warns | Use TeX or LaTex markup | Remove 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 instead | The 'italic' option | Replace all instances of setting the FontAngle property
to 'oblique' with 'italic' . |
Using the line function with the dot value
('.' ) for LineStyle property | Errors | The ':' option for dotted lines | Replace all instances of setting the LineStyle property
to '.' with ':' . |
DrawMode axes property | Warns | The SortMethod axes property | Remove all instances of the DrawMode property.
Use the SortMethod property
instead. |
NormalMode property for surface and patch
objects | Warns | The VertexNormalsMode or FaceNormalsMode property | Remove all instances of the NormalMode property.
Use the VertexNormalsMode or FaceNormalsMode property
instead. |
lighting phong syntax | Uses gouraud lighting instead | lighting gouraud | Replace all instances of lighting phong with lighting
gouraud . |
'phong' value for the EdgeLighting and FaceLighting properties
for surface and patch objects | Uses 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 objects | Title , XLabel , YLabel ,
and ZLabel axes
properties | The 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 function | Errors | Not applicable | Remove 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 function | Warns | Not applicable | Remove all instances of using these inputs with the opengl function. |
'zbuffer' option for the figure Renderer property | Uses OpenGL renderer instead | The 'opengl' or 'painters' options | Replace all instances of setting the Renderer property
to 'zbuffer' with 'opengl' or 'painters' .
The default renderer is 'opengl' . |
ResizeFcn figure property | Still runs | SizeChangedFcn figure property | Use of the ResizeFcn figure property is
not recommended. Use the SizeChangedFcn figure
property instead. |
FixedColors , MinColorMap , WVisual , WVisualMode , XVisual ,
and XVisualMode figure properties | Errors | Not applicable | Remove all instances of figure properties that are no longer supported. Use supported figure properties. |
Selected and SelectionHighlight figure
properties | No effect | Not applicable | Remove all instances of the Selected and SelectionHighlight figure
properties. |
'fullcrosshair' option for the figure Pointer property | Warns | Not applicable | Remove 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 Visible | Errors | Not applicable | Remove 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 function | Returns single chart line object | Not applicable | Specifying 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 function | Returns a vector of two chart line objects | Not applicable | Specifying 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. |
Functionality | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
pagesetupdlg function | Warns | printpreview | Replace all instances of pagesetupdlg with printpreview . |
-crossplatform and -setup options
for printdlg function | Warns | Not applicable | Remove all instances of using the -crossplatform and -setup options
with printdlg . |
Using getframe function to capture content
outside of the figure window | Warns | Specify area within figure window | Specify an area within a figure window when using getframe function. |
-dsetup print option | Errors | Not applicable | Remove all instances of the -dsetup print
option. |
'all' option for hgsave and hgload functions | Errors | Not applicable | Remove 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' | Errors | Not applicable | Remove instances of setting the PaperSize property
when the PaperUnits property is set to 'normalized' . |
mmat option for saveas function | Errors | savefig function | Remove 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 syntax | Errors | savefig function
or the figure menu | Remove 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 option | Errors | -depsc or -dsvg print
options for vector graphics formats | Remove all instances of using the -dill print
option. For vector graphics formats, use -depsc or -dsvg option
instead. |
-adobecset print option | Errors | Not applicable | Remove 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 , -dpjxl300 | Errors | Not applicable | Remove 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 1 | PostScript Level 3 output | Not applicable | PostScript Level 1 output is no longer supported. |
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.
The new MATLAB graphics system introduces these changes to the GUI building tools:
All UI 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.
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 UIs. See Why Are Some Components Missing or Partially Obscured? for more information.
UI 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 | Result | Use Instead | Compatibility Considerations |
---|---|---|---|
selectmoveresize | No effect | plotedit | Replace all instances of selectmoveresize with plotedit . |
The Selected and SelectionHighlight properties
of figure , uicontrol , uitable , uipanel , uibuttongroup , uipushtool ,
and uitoggletool . | No effect | Not applicable | Remove 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 runs | SizeChangedFcn property | Use 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 property | Warning | Not applicable | Remove 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 uibuttongroup | Still runs | SelectionChangedFcn property | Use of the SelectionChangeFcn property
is not recommended. Use the SelectionChangedFcn property
instead. |
The Clipping property of uicontrol , uitable ,
and graphics root | Error | Not applicable | Remove 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. | Error | Not applicable | Remove all instances of setting the uipanel or uibuttongroup BackgroundColor property
to 'none' . |
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™
sort
The performance of the sort
function
improves for large categorical array inputs.
typecast
function performance improvements with long vectorsThe performance of the typecast
function
improves for long input vectors.
Pop-up Command History (2 min, 41 sec)
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.
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 n
th 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.
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.
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.
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.
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.
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.
mex
-setup
is no longer necessary in most situationsSetting 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 statusmex
, 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.
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 charactersIf you specify
parameters
when you invoke varname
=varvalue
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 settingmex
-setup
selects a
compiler for a given language, lang
. If lang
is
not specified, mex
-setup
searches
for C compilers.
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
.
flipud
, fliplr
, and rot90
functionscircshift
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
.
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])
.
validatestring
validatestring
now
validates empty strings.
V = validatestring('',{'Cantor','','Koch'})
V = ''
validatestring
results in an error.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 identifiersThe 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 arraysFor more information, see details
.
isprop
Calls to isprop
with
empty objects now return an empty logical array instead of false
.
Change code that relies on isprop
retuning false
for
empty objects.
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\.')
f = C:\foo\folder2 g = C:\foo\folder1\folder3\ h = \\folder4\.
f = C:\foo\folder1\..\folder2 g = C:\foo\folder1\\\folder3\\ h = \\folder4\.
Change code that relies on locating exact strings containing repeated file separators or dot and double-dot symbols in a full file path.
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.
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 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) outputThe 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.
matlab.unittest
pluginsThe 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.
The PublicPropertyComparator
can
be used with the IsEqualTo
constraint
to compare public properties of MATLAB objects recursively.
MATLAB supports Visual C++ 2013 compilers for building MEX-files on Microsoft Windows 32- and 64-bit platforms.
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.
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 | What Happens When You Use This Functionality? | Use This Instead | Compatibility Considerations |
---|---|---|---|
| Still runs |
| In a future release, the behavior of To retain current behavior, use |
| Still runs | Replace all instances of | |
| Warns | Replace all instances of | |
| Errors |
| Replace all instances of To
create a time series object, use To
create a time series collection with one or more To
open a time series object or collection in the Variables editor, use To
plot a time series object, use |
| Still runs | Replace all instances of S = {'my.Name','my_Name','my_Name'}; N = matlab.lang.makeValidName(S); U = matlab.lang.makeUniqueStrings(N,... {},namelengthmax); | |
| Warns | Replace all instances of | |
| Warns | Replace all instances of | |
| Errors | copy | Replace all instances of createCopy with copy . |
| Warns | For building engine and MAT-file applications, use Replace custom | |
| Always returns |
| Replace all instances of |
isdiag
, isbanded
, issymmetric
, ishermitian
, istril
, istriu
, and bandwidth
functions for testing matrix structureThe 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 equationThe sylvester
function
solves the Sylvester equation, AX + XB = C, for X
.
eig
function for computing left eigenvectorsThe 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'
.
rand
, randi
, and randn
functions for creating arrays of random
numbers that match data type of an existing variablemean
The mean
function
now supports inputs of any integer data type.
complex
function with one complex inputThe 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.
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.
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))
.
Webcam Support (2 min, 54 sec)
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
Connecting
to Webcams — how to use the webcamlist
function
to detect your cameras
Acquiring Images from Webcams — how to acquire live images from your camera into MATLAB
Setting Properties for Webcam Acquisition — how to set object- or device-specific properties for the acquisition
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.
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 | What Happens When You Use This Functionality? | Use This Instead | Compatibility Considerations |
---|---|---|---|
aufinfo | Warns | audioinfo | Replace all instances of aufinfo with audioinfo . |
auread | Warns | audioread | Replace all instances of auread with audioread . |
auwrite | Warns | Write audio files using audiowrite . | |
wavfinfo | Warns | audioinfo | Replace all instances of wavfinfo with audioinfo . |
wavread | Warns | audioread | Replace all instances of wavread with audioread . |
wavwrite | Warns | audiowrite | Replace all instances of wavwrite with audiowrite . |
wavplay | Errors | audioplayer and play | Replace all existing instances of wavplay with audioplayer and play . |
wavrecord | Errors | audiorecorder and record | Replace all existing instances of wavrecord with audiorecorder and record . |
mmreader | Errors | VideoReader | Replace all instances of mmreader with VideoReader . |
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.
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 | What Happens When You Use This Functionality? | Use This Instead | Compatibility Considerations |
---|---|---|---|
HitTest , Selected ,
and SelectionHighlight properties for these components:
| Still runs | Not applicable | Use 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. |
conv2
function performance improvements with three inputsThe performance of the conv2
function
improves when using the conv2(h1,h2,A)
syntax.
filter
function performance improvements for FIR and IIRThe 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)
View release notes for older releases