Live Editor: Pan, zoom, and rotate axes in output figures
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.
Live Editor: Create and edit equations interactively using the equation editor
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.
Live Editor: Create new sections and format text quickly using autoformatting
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.
Live Editor: Automatically rename all functions or variables in a live script
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.
Live Editor: Drag and drop selected code and text within a live script and between other applications
Drag selected code from a live script to and from another application, maintaining syntax highlighting and font characteristics.
Live Editor: View outputs sooner when running live scripts
The Live Editor now displays output in live scripts as it is created, instead of when the execution of a section is complete.
Command Window: View updated display for arrays, including headers indicating class, size, and shape
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.
Product Trials: Download trials for MathWorks products using Add-On Explorer
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.
Toolbox Packaging: Include live script examples, generate info.xml
and
helptoc.xml
templates for custom documentation, and modify Java class path on installation
When 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.
Preferences: Save preferences to new default location on Mac
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
.
Documentation: Find examples faster across MathWorks products
Browse examples across MathWorks products or search for examples using the search box and search filters. To access examples online, go to https://www.mathworks.com/help/examples.html. To access examples in MATLAB, go to the Home tab and click Help > Examples.
Documentation: Open and run examples in MATLAB
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.
Functions in Scripts: Define local functions in scripts for improved code reuse and readability
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
Run Section and
Run and Advance buttons are disabled. To run the script, type
the saved script name in the Command Window or click
Run. You can run sections individually in live scripts
containing local functions.
string
Array: Manipulate, compare, and store text data
efficiently
string
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 synchronization
The 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 table
You 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
property
You 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
recursively
Search through folders and subfolders on the path recursively using wildcards in the
path name. For more information, see dir
.
Note
The *
character is now always treated as a wildcard, even on
file systems that support *
in file names.
Search Path: Add folders to the MATLAB search path using relative paths
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.
Search Path: Add folders to the MATLAB search path using the MATLABPATH
environment variable
on Windows
MATLAB 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 array
You 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 expression
You 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))
.
Private Functions: Visibility rules changed
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.
Message Identifiers: Update code to use modified error message identifiers
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 being removed or changed
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: Apply element-wise operations and functions to arrays with automatic expansion of dimensions of length 1
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 of execution, better memory usage, and improved
readability of code.
If your code uses any of the element-wise operators or functions listed above and
relies on the errors that MATLAB returns from mismatched sizes, particularly within a
try/catch
block, then your code might no longer catch those
errors. This change is because some combinations of input sizes that previously
caused errors are now valid.
For example, in older releases of MATLAB, you could not add a row and a column vector, but those operands are
now valid for addition with implicit expansion. In other words, an expression like
[1 2] + [1; 2]
previously returned a size mismatch error, but
now it executes.
This compatibility consideration does not apply to any uses of
bsxfun
.
graph
and digraph
Objects: Compute graph
isomorphism, biconnected components, cut vertices, and node condensation
Graph objects created using either graph
or digraph
support these functions:
isomorphism
— 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-D
The 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
function
The flipedge
function reverses the direction of directed edges in a
graph.
conv2
Function: Compute 2-D convolutions with improved
performance
The conv2
function performs faster when using the syntax
conv2(u,v,A)
, where u
and v
are vectors and A
is a matrix.
Functionality being removed or changed
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. |
Date and Time Plotting: Use datetime or duration data in common plotting functions, and customize plots with datetime and duration rulers
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 coordinates
To 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) =
0
To 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.
Tick Formatting Functions: Customize text, position, rotation, and format for axis tick labels
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
property
To 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 counts
Plot 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.
Contour Plots: Generate contour matrix with improved performance
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 being removed or changed
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 systems
The 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 applications
Now 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 text
Use 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 file
You 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'
parameter
The 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
certificates
To 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.
Scientific File Format Libraries: CDF Library upgraded to version 3.6.1
The CDF library has been upgraded to version 3.6.1.
Functionality being removed or changed
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
memory
Tall 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).
Missing Data Functions: Find, fill, and remove missing data from arrays or tables
with 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.
discretize
Function: Discretize datetime
and
duration
arrays to separate time-stamped data into regular time
intervals
The discretize
function accepts datetime
and
duration
arrays as inputs.
Constrained Pan and Zoom: Pan or zoom in a single dimension for 2-D and 3-D plots
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 being removed or changed
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 . |
App Designer: Include common 2-D plots in apps, such as area
,
bar
, contour
, histogram
,
yyaxis
, and function plots
Now you can display most 2-D plots in your app. For more information, see Graphics Support in App Designer.
App Designer: Create legends for 2-D plots in apps
Add legends and color bars to your plots in App Designer. For more information, see Graphics Support in App Designer.
App Designer: Embed tabular displays using uitable
in apps
Use 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.
App Designer: Create callback functions that can be shared across multiple components
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.
App Designer: Add, position, and resize labeled components, and create components with names derived from labels
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.
App Designer: Edit spinners and numeric edit field values directly in the canvas and duplicate components into different parents
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.
App Designer: Learn App Designer workflow by showing tips in the code view
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.
App Designer Components: 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.
Edit Field Component: Use the ValueChangingFcn
property to execute
a callback when users edit the value in the UI
ValueChangingFcn
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.
Positioning Containers Programmatically: Access the outer bounds and drawable area of containers such as panels and button groups
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 values
The 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
App Packaging: Automatically include dependent files when packaging apps
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 Display: Render plots with large numbers of markers faster using less memory
Graphics that contain large numbers of markers have improved performance and use less memory.
Execution Engine: Execute tight loops with scalar math faster
Performance is improved for MATLAB code that is dominated by tight loops, straightforward indexing, and simple math.
Execution Engine: Construct objects faster
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.
iPhone and Android Sensors: Log data from mobile sensors on the MathWorks Cloud over a Wi-Fi or cellular network
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.
Arduino: Write to shift registers
Write to shift registers using the MATLAB Support Package for Arduino® Hardware.
Raspberry Pi: Generate PWM signals and control servo motors from GPIO pins on Raspberry Pi
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.
Raspberry Pi: Support for Raspberry Pi 3 Model B
You can use the MATLAB Support Package for Raspberry Pi Hardware with the Raspberry Pi 3 Model B hardware board.
Raspberry Pi: Read from sensors and write to the LED matrix on a Raspberry Pi Sense HAT
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.
Raspberry Pi: Run Linux and file management commands faster
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
control
For more information, see HTTP Interface.
MATLAB Engine API for Java: Run MATLAB code from Java programs
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.
matlab.mixin.SetGet: Allow inexact property names by default in calls to set and get
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.
matlab.mixin.SetGetExactNames: Require exact property names in calls to set and get
Classes derived from matlab.mixin.SetGetExactNames
require case-sensitive,
exact property name matches in calls to the set
and get
methods.
Unit Testing Framework: Generate Microsoft Word or Adobe PDF reports of a test run
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.
Unit Testing Framework: Improve continuous integration workflows using TAP Version 13
protocol and YAML diagnostics with the 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.
Unit and Performance Testing Frameworks: Improve code reuse and readability by using local functions in script-based tests
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.
Unit and Performance Testing Frameworks: Tests that qualify that an empty character vector is a substring now pass
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.
Object Constructors: Construct objects faster with certain constraints
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.
Java: Pass 0-length arrays
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
.
Python Version 3.5: MATLAB support
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.
Python Version 3.3: Support to be phased out
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.
Source Control Integration: Customize external source control tools to use MATLAB to compare and merge
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.
Source Control Integration: Include Git Submodules
To reuse code from another repository, you can specify Git™ submodules. For more information, see Add Git Submodules.
Source Control Integration: Fix problems with working copy locks using SVN Cleanup option.
Remove stale working copy locks using the SVN Cleanup option. For more information, see Get SVN File Locks.
Compiler support changed for building MEX files and standalone MATLAB engine and MAT-file applications
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 being removed or changed
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. |
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.