Main Content

R2017b

New Features, Bug Fixes, Compatibility Considerations

Desktop

Live Editor: Write MATLAB commands with automated, contextual hints for arguments, property values, and alternative syntaxes​​​​​

When writing commands, MATLAB® automatically displays contextual hints for arguments, property values, and alternative syntaxes. For example, if you want to use the size function, MATLAB displays the syntax information to help you write the command.

MATLAB also automatically suggests and completes the names of functions, models, MATLAB objects, files, folders, variables, structures, graphics properties, parameters, and options. For more information, see Automatic Code Suggestions and Completions.

Live Editor: Export live scripts to LaTeX format​​​​​​​​​

To export your live script to LaTeX format, on the Live Editor tab, select Save > Export to LaTeX. MATLAB creates a separate Extensible Stylesheet Language (XSL) file in the same folder as the output document, if one does not exist already. XSL files give you more control over the appearance of the output document. For more details, see Share Live Scripts.

Live Editor: Display high-resolution plots in PDF output​​​

When saving a live script as a PDF, MATLAB now includes high-resolution plots in the PDF file.

Live Editor: Horizontally align text, equations, and images​​​​​​​​​​​

You can horizontally align text, equations, and images in live scripts. On the Live Editor tab, in the Text section, select left , center , or right .

For more information, see Format Live Scripts.

Live Editor: Automatically match delimiters and wrap comments while editing code​​

MATLAB autocompletes parentheses and quotes when entering code in the Live Editor. For example, if you type r = rand(, MATLAB automatically adds the closing parentheses to the statement (r = rand()). The Live Editor also autocompletes any comments, character vectors, and strings that are split across two lines.

For more information, see Run Code.

Live Editor: View and scroll through table data, including variable and row names​​​​​​​​

Use scroll bars to explore data in tables and timetables in live scripts. View the variable and row names included in the tables.

Live Editor: Check code for errors and warnings using the message bar and message indicator

Determine whether a live script contains an error or warning using the message indicator. Navigate through errors and warnings using the message bar. For more information, see Check Code for Errors and Warnings.

Documentation: Use the Live Editor in a web browser to open, edit, and run MATLAB online documentation examples

Open, edit and run live script examples directly from the MATLAB online documentation using the Live Editor in a web browser. To open an example, click the Try this Example button to the right of the example and select Try it in your browser.

MATLAB Drive: Store, access, and manage your files from anywhere

If you have MATLAB Drive™ Connector installed on your system, you can access files and folders in your drive from MATLAB using the Current Folder browser.

To view your recent activity, in the Current Folder browser, right-click any MATLAB Drive file or folder and select MATLAB Drive > View Recent Activity.... To open MATLAB Drive online, right-click any MATLAB Drive file or folder and select MATLAB Drive > Go to MATLAB Drive Online....

For more information, see Manage Files and Folders or the MATLAB Drive documentation.

Add-On Manager: Customize your MATLAB environment by enabling and disabling add-ons​​​​​​

Enable and disable add-ons in the Add-On Manager to customize your MATLAB environment. To enable an add-on in the Add-On Manager, click the button to the right of the add-on and select Enabled. This option is only available for apps, toolboxes, functions, collections and Simulink® models.

You also can enable or disable the add-on using the matlab.addons.enableAddon and matlab.addons.disableAddon functions.

Add-On Manager: Find installed add-ons faster using sort and search​​​​​​​​​​

Use sort and search in the Add-On Manager to find installed add-ons more efficiently.

Toolbox Packaging: Create a Getting Started Guide for your toolbox from a Live Script template​​​​​​​​​​​​​

You can create a Getting Started Guide when you package your toolbox. Users of your toolbox can view the Getting Started Guide through the Options menu for the toolbox in the Add-On Manager. After you select your toolbox folder, the option to create a Getting Started Guide appears in the Examples, Apps, and Documentation section of the Package a Toolbox dialog box. For more information, see Create and Share Toolboxes.

Toolbox Packaging: Share your toolbox on File Exchange directly when you package it​​​​

When you are creating your toolbox, you can package the toolbox and share it on MATLAB Central File Exchange. Select Package and Share from the Package menu at the top of the Package a Toolbox dialog box. This option opens a web page for your toolbox submission to File Exchange submission. MATLAB populates the File Exchange submission form with information from the Package a Toolbox dialog box. Review and submit the form to share your toolbox on File Exchange. For more information, see Create and Share Toolboxes.

Command Window: View updated display for cell arrays

When displaying cell array outputs, the Command Window now displays curly braces around each cell. The curly braces show the delimiters of the cell and help unify the display of the cell array.

Use curly braces to access the contents of a cell. For example, this code creates a 2-by-3 cell array of text and numeric data, and then displays the contents of the last cell in the cell array.

C = {'one', 'two', 'three'; 1, 2, 3}
last = C{2,3}
C =
  2×3 cell array
    {'one'}    {'two'}    {'three'}
    {[  1]}    {[  2]}    {[    3]}

last =
     3
Additionally, if a cell contains a numeric empty value, then the Command Window displays the class and size of the cell.

For more information, see Create Cell Array.

Language and Programming

Code Compatibility Report: Generate a report that helps the updating of code to a newer MATLAB release​​

You can generate a report of potential compatibility issues in your code using the codeCompatibilityReport function. For example, the report contains information about the use of discouraged or removed functions in your code and the occurrence of invalid syntaxes. After you upgrade to a newer version of MATLAB, you can use this report to identify potential compatibility issues in your existing code.

Alternatively, you can create a CodeCompatibilityAnalysis object to save results using the analyzeCodeCompatibility function.

isStringScalar Function: Determine whether input is a string array with one element

To determine whether the input argument is a string array that has only one element, use the isStringScalar function.

convertStringsToChars and convertCharsToStrings Functions: Enable your code to accept all text types as inputs without otherwise altering your code

To make your existing code accept strings as input arguments, you can use the convertStringsToChars function on the entire input argument list. convertStringsToChars converts input string arrays to character vectors or cell arrays of character vectors while returning all the other input arguments unaltered. If you add convertStringsToChars to the beginning of your code, then you do not need to make any other changes to accept strings as inputs.

Similarly, convertCharsToStrings converts input character vectors or cell arrays of character vectors to string arrays while returning the other input arguments unaltered. If you have code that works with strings, then you can add convertCharsToStrings to the beginning so that it also accepts character arrays as inputs.

arrayfun, cellfun, and structfun Functions: Return object arrays as output arguments

The arrayfun, cellfun, and structfun functions can return object arrays of any data type, so long as the objects can be concatenated.

Scripts: Run sections in scripts containing local functions

You can run an individual section in a script that contains local functions. To run a section, on the Editor or Live Editor tab, click Run Section.

Note

You must fix all syntax errors in the script before running an individual section.

isfile and isfolder Functions: Determine if input is a file or a folder

Use the isfile and isfolder functions to determine if an input is a file or a folder located on the specified path or in the current folder.

For example, this code creates a folder, and then it uses the isfile and isfolder functions to check whether the input is a file or folder:

mkdir myfolder;
result1 = isfile('myfolder')
result2 = isfolder('myfolder')
result1 =
  logical
   0

result2 =
  logical
   1

Functionality being removed or changed

FunctionalityResultUse This InsteadCompatibility Considerations

The cellstr function converts missing values in an input string array to 0-by-0 character arrays in the output cell array.

Still runs

Not Applicable

Starting in R2017b, cellstr converts missing values in string arrays to 0-by-0 character arrays. In R2016b and R2017a, cellstr throws an error if the input argument is a string array that contains missing values.

isdir

Still runs

isfolder

Replace all instances of isdir with isfolder.

isdir searches for folders on the search path, which can lead to unexpected results. isfolder searches for folders only on the specified path or in the current folder.

On Windows®, tempdir checks first for the existence of TMP, and then for TEMP.Still runsNot ApplicableOn Windows, the tempdir function now checks first for the existence of the TMP environment variable, and then it checks for the TEMP environment variable. It uses the first path found. Previously, tempdir checked first for the existence of TEMP.

On Linux® and Mac, tempdir function uses TMPDIR.

Still runs

Not Applicable

On Linux and Mac, the tempdir function now uses the TMPDIR environment variable, if it is defined.

Using a MATLAB identifier to call a function, and then using it as a variable name inside the same function

Warns

Choose different MATLAB identifiers for local or imported functions and variable names.

In a future release, using the same identifier for a local or imported function, and then using it for a variable name will result in an error. For example, in a future release, both of the following functions will result in an error.

function myFunc()
    x = containers.Map; 
    containers = 1;
end
function myFunc2()
    import java.lang.*
    % includes java.lang.String
    s = String('Hello');
    String = 1;
end

Indexing into an implicitly defined variable in a function

Still runs

Explicitly define a variable before indexing in to it.

Currently, an identifier without an explicit declaration is classified as a variable when it is indexed with the colon, end, or curly braces. For example, X(a,b,:), X(end), or X{a}. In a future release, if a function of the same name exists on the path, the variable will be classified as a function.

Consider the following code:

function myfunc()
    load data.mat;
    disp(x(:))
end
If you intend to use x as a variable from data.mat instead of a function, explicitly define it.
function myfunc()
    load data.mat x;
    disp(x(:))
end

Similarly, to use x as a variable obtained from a script, define the variable before invoking the script. This behavior also applies if the variable is implicitly introduced by any of the following functions: sim, eval, evalc, and assignin. For example, if myscript.m defines x, define x before calling myscript.

function myfunc2()
    x = [];
    myscript;
    disp(x(:))
end

Sharing uninitialized variables between a nested function and the parent function

Still runs

Explicitly define shared variables in the parent function before calling the nested function.

Consider the following code.

function myfunc()
    nested();
    x;
    function nested()
        x = 1;
    end
end
Currently, if x is a function on the path, MATLAB classifies it as a function in myfunc and a variable in nested. Otherwise, MATLAB classifies it as a variable shared between nested and myfunc.

To avoid potential function behavior differences depending on the state of your MATLAB path, explicitly define shared variables in the parent function.

function myfunc()
    x = 0;
    nested();
    x;
    function nested()
        x = 1;
    end
end 

Nested functions in MATLAB do not inherit import statements from the parent function.

Still runs

Not Applicable

The plot statement in the following nested function calls the plot function on the path, not the pkg.plot function.

In the future, MATLAB will call the plot function in pkg.plot.

function myfunc
import pkg.plot
    function nested
        plot
    end
end

Similarly, in the following example, even if the plot function is defined in pkg.*, MATLAB calls the function on the path. However, in the future, MATLAB will call the function in imported package pkg.*.

function myfunc
import pkg.*
    function nested
        plot
    end
end
ans in nested functions

Still runs

Not Applicable

Nested functions now access and modify the ans variable that is defined in the parent function. In future releases, nested functions will have access to the ans variable even if the variable is declared implicitly by not suppressing the output. For example in future releases, in this code, ans returns 1.

function foo
    a=1;
    a  % Assigns “ans” to 1.
    nested()
    function nested
       ans % will be 1
    end
end

Using ans as a function name

Warns

Not Applicable

Rename all functions with the name ans. In a future release, using ans as a function name issues an error.

Declaring a variable as global after referencing it

Warns

Declare variables as global before using them.

Currently, if you declare a variable as global after referencing it, MATLAB issues a warning and the variable becomes a global variable. In a future release, this will result in an error.

MATLAB disables folder change detection for all of matlabroot

Still runsNot applicableMATLAB now disables folder change detection for all of the files and folders in the matlabroot folder. Previously, MATLAB only disabled folder change detection for the files and folders in matlabroot/Toolbox. For more information, see Toolbox Path Caching in MATLAB.

Mathematics

decomposition Object: Solve linear systems repeatedly with improved performance

decomposition objects efficiently store a matrix decomposition for repeated use in solving linear systems Ax = b or xA = b. These objects enable you to leverage the performance benefits of precomputing the matrix decomposition, but they do not require knowledge of how to use the matrix factors.

lsqminnorm Function: Find minimum-norm solution of underdetermined linear system

For underdetermined least-squares problems A*x ≈ b where several equivalent least-squares solutions exist, x = lsqminnorm(A,b) returns the least-squares solution x that minimizes norm(x) among all vectors that minimize norm(A*x-b).

Previously, this functionality was available in a limited fashion using x = pinv(A)*b. However, lsqminnorm is faster since it does not need to compute the pseudoinverse pinv(A), and it also supports sparse matrices.

dissect Function: Reorder sparse matrix columns using nested dissection ordering

Use the dissect function to generate fill reducing orderings of sparse matrices. The fill reducing ordering produced by dissect tends to reduce storage and computation time for sparse matrix factorizations when compared to other reordering functions such as amd.

vecnorm Function: Compute vector-wise norms of arrays

Use vecnorm to compute the norm of the rows and columns of a numeric N-dimensional array. Unlike the norm function that computes the matrix norm, vecnorm treats the elements along a specified dimension as vectors and calculates the norm of each vector.

polyshape Object: Create, analyze, and visualize 2-D polygons

The polyshape function enables you to create a polygon from a list of 2-D vertices. For example, p = polyshape([0 0 1 1],[0 1 1 0]) creates a square with vertices (0,0), (0,1), (1,1), and (1,0).

After you create a polyshape object p, use the command plot(p) to visualize it. You also can compute common geometric quantities of p, such as its centroid and area. You can transform p using translation, rotation, or scaling, and you can query properties of p such as its number of boundaries or holes. If you are working with multiple polygons, then you can compute quantities, such as their intersection and union.

eigs Function: Improved algorithm and new options

The eigs function has a new algorithm, more intuitive behavior, and new options to simplify usage.

  • New sigma options

    This table summarizes the new, more descriptive options for sigma. These changes do not require any updates to existing code since the old values continue to be supported.

    Old sigmaNew sigmaWhich eigenvalues?
    'LM''largestabs'max(abs(d))
    'SM''smallestabs'min(abs(d))
    'LA' (if real symmetric), 'LR' (otherwise)'largestreal'max(real(d))
    'SA' (if real symmetric), 'SR' (otherwise)'smallestreal'min(real(d))
    'BE' (if real symmetric)'bothendsreal'Combination of values returned by 'largestreal' and 'smallestreal'
    'LI' (if complex)'largestimag'max(imag(d))
    'SI' (if complex)'smallestimag'min(imag(d))
    'LI' (if real nonsymmetric)'bothendsimag'Combination of values returned by 'largestimag' and 'smallestimag'

  • sigma values 'LR', 'LA', 'SR', 'SA', and 'BE' accept both symmetric and nonsymmetric matrices

    If an eigenproblem is symmetric, it has real eigenvalues. For that reason 'LR'/'LA' and 'SR'/'SA' now are considered to be equivalent by eigs.

    In the nonsymmetric case, the 'BE' option uses the real part of each eigenvalue to determine which eigenvalues to return. The behavior is unchanged for problems that previously allowed the 'BE' option.

  • Alternative name-value pairs for options

    This table contains a one-to-one mapping of the old option structure fields to the corresponding new name-value pairs. These changes do not require any updates to existing code since the options structure continues to be supported.

    Options Structure FieldName-Value PairNew Behaviors
    issym'IsFunctionSymmetric'This option is used only for function handle inputs. For matrix inputs, eigs ignores this option.
    isreal-eigs ignores this option because the new algorithm does not need to know whether the input matrix is real or complex.
    tol'Tolerance'New default value of 1e-14.
    maxit'MaxIterations' 
    p'SubspaceDimension' 
    v0'StartVector'eigs uses the same starting vector for each call so that the output is reproducible between calls.
    disp'Display'A display value of 2 no longer returns timing information. Instead, eigs treats a value of 2 the same as a value of 1. Also, the messages shown by the 'Display' option have changed. The new messages show the residual in each iteration, instead of the Ritz values.
    spdB'IsSymmetricDefinite'New option.
    cholB'IsCholesky' 
    permB'CholeskyPermutation' 
    fail'FailureTreatment'New option.
Compatibility Considerations

The eigs function also has some new behaviors that affect the output and might require updates to code.

  • Changes to sorting order of output

    eigs now sorts the output according to the value of sigma. For example, the command eigs(A,k,'largestabs') produces k eigenvalues sorted in descending order by magnitude.

    Previously, the sorting order of the output produced by eigs was not guaranteed.

  • Reproducibility

    Calling eigs multiple times in succession now produces the same result. Set 'StartVector' to a random vector to change this behavior.

  • Display

    A display value of 2 no longer returns timing information. Instead, eigs treats a value of 2 the same as a value of 1. Also, the messages shown by the 'Display' option have changed. The new messages show the residual in each iteration, instead of the Ritz values.

svds Function: Set options with name-value pairs

You can use name-value pairs to set options with svds instead of using an options structure. This table contains a one-to-one mapping of the old option structure fields to the corresponding new name-value pairs.

These changes do not require any updates to existing code since the options structure continues to be supported.

Options Structure FieldName-Value Pair
tol'Tolerance'
maxit'MaxIterations'
p'SubspaceDimension'
u0'LeftStartVector'
v0'RightStartVector'
fail'FailureTreatment'
disp'Display'

Interpolation Functions: Method for modified Akima cubic Hermite interpolation

The griddedInterpolant, interp1, interp2, interp3, and interpn functions now support the interpolation method 'makima'. This modified Akima cubic Hermite interpolation method has these properties:

  • It is C1 continuous.

  • It produces fewer undulations than 'spline', but the result is not as aggressively flattened as 'pchip'.

  • Unlike 'pchip', it supports N-D arrays.

  • Unlike 'spline', it does not produce overshoots.

convn Function: Compute convolutions on multidimensional arrays with improved performance

You can compute convolutions on multidimensional arrays faster with the convn function.

subgraph and highlight Functions: Specify graph nodes with logical vector

The subgraph and highlight functions for network analysis now accept a logical vector to select nodes.

Functionality being removed or changed

FunctionalityResultUse This InsteadCompatibility Considerations

[bins,edges] = discretize(X,dur) where X is a datetime or duration array

Still runs

N/A

In R2017a and later releases, discretize(X,dur) operating on a datetime or duration array X uses a maximum of 216 = 65536 bins. This aligns the behavior of discretize with that of histcounts and histogram. In releases before R2017a, discretize did not impose this limitation on the number of bins in the result.

Graphics

geobubble Function: Create an interactive map with bubbles whose size and color vary with data values

Create an interactive map with bubbles whose size and color vary with data values using geobubble.

wordcloud Function: Display words at different sizes based on frequency or custom size data

Display words at different sizes based on frequency or custom size data using wordcloud.

binscatter Function: Visualize data density with dynamic bin size adjustment

Use binscatter to visualize binned scatter plots and identify trends and relationships in arrays of data. binscatter produces a plot that is similar to a 2-D histogram (histogram2). However, since the binscatter function has custom zoom behavior that increases the resolution as you zoom in, it is better suited for visual exploration of data.

Tall Array Support: Visualize out-of-memory data using plot, scatter, and binscatter

The plot, scatter, and binscatter functions now support tall arrays. These functions plot the data in iterations, progressively adding to the plot as more data is read. Zooming and panning is supported during the updating process before the plot is complete.

heatmap Function: Sort rows and columns and use custom labels in a heatmap

You can make new types of modifications to a heatmap, such as reordering or relabeling the values along each axis. Use the new HeatmapChart listed in this table. If you want to reorder the values, you also can use the sortx and sorty functions.

PropertyDescription
XData and YDataValues associated with the rows or columns in ColorData.
XDisplayData and YDisplayDataOrder of values along the x-axis or y-axis. Use these properties to view, rearrange, or show only a subset of the values.
XDisplayLabels and YDisplayLabelsLabels for x-axis or y-axis values. Use these properties to view or relabel the values.
XLimits and YLimitsFirst and last value displayed along the x-axis or y-axis.
ColorDisplayDataValues as they appear in the heatmap, sorted based on XDisplayData and YDisplayData. This is a read-only property.

For an example, see Create Heatmap from Tabular Data.

bar Function: Control individual bar colors

Specify a different color for each bar using the new CData property for Bar objects. For example, create a bar chart and change the color of the second bar.

b = bar(rand(10,1));
b.FaceColor = 'flat';
b.CData(2,:) = [.5 0 .5];

For more information, see Bar Properties.

Chart Colors: Create bar and area charts with new default colors

Similar to line charts, bar charts and area charts now use colors from the ColorOrder property of the Axes object. Previously, the charts used colors from the colormap.

This table shows the color difference for bar charts.

R2017b and Later (ColorOrder)Previous Releases (Colormap)

This table shows the color difference for area charts.

R2017b and Later (ColorOrder)Previous Releases (Colormap)

Compatibility Considerations

Bar charts and area charts use different colors than in previous releases.

  • To create a bar chart that uses colormap colors, set the FaceColor property to 'flat'. Then set the CData property for each Bar object to an integer. For example:

    y = [1 3 5; 3 2 7; 3 4 2];
    b = bar(y,'FaceColor','flat');
    for k = 1:size(y,2)
        b(k).CData = k;
    end
    

  • To create an area chart that uses colormap colors, set the FaceColor property to 'flat'. For example:

    y = [1 3 5; 3 2 7; 3 4 2];
    area(y,'FaceColor','flat')

Axes Object: Specify the target axes for more functions

These functions now support an Axes object as the first input argument: camlight, hidden, ishold, lightangle, lighting, and material.

Functionality being removed or changed

FunctionalityResultUse This InsteadCompatibility Considerations
Default colors for bar and area chartsStill runsNot applicableBar and area charts have new default colors. These charts use colors from the color order instead of colormap colors. For more information, see Chart Colors: Create bar and area charts with new default colors.
Default axis limits for bar charts, histograms, and graph plotsStill runsNot applicableBar charts, histograms, and graph plots might use slightly different limits than in previous releases. These charts automatically choose limits that center the data. If you want to specify different limits, use the xlim and ylim functions.
barh function with the Horizontal parameterWarnsbar functionRemove instances of code that uses the barh function with the Horizontal parameter. To create a vertical bar chart, use the bar function. To create a horizontal bar chart, use the barh function.
bar3 function with a line style or marker symbol specificationErrorsNot applicableRemove instances of code that passes a line style or marker symbol to the bar3 function, such as bar3(y,z,'r:*'). In previous releases, the line style and marker symbol are ignored. Instead, specify only the color, such as bar3(y,z,'r').
legend functionStill runsNot applicable

The legend function now always creates a legend associated with the current or specified axes. If the axes do not contain any data, then the legend function creates an empty legend. If axes do not exist, then the legend function creates axes with an empty legend.

In previous releases, the legend function does not always create a legend. For example, it does not create a legend if there are no axes or no data in the axes. For these cases, the function returns a warning message instead. Also, the lgd = legend syntax (with no input arguments) returns an existing legend, but does not create one if a legend does not already exist.

To query for the existence of a legend associated with a particular axes without creating a new one, use the Legend property of the Axes object. For example:

ax = gca;
lgd = ax.Legend

subplot function when setting the OuterPosition or ActivePositionProperty property as name-value pair argumentsWarnsPosition parameterRemove instances of code that sets the OuterPosition or ActivePositionProperty property as name-value pair arguments to the subplot function. If you want to specify the subplot position, use the Position property.
subplot function when specifying the subplot location using both the grid position and the Position parameterWarnsEither a grid position or the Position parameter (not both)You cannot specify the subplot location using both a grid position and the Position parameter, such as subplot(m,n,p,'Position',[x y w h]). Instead, use either the grid position or the Position parameter, such as subplot(m,n,p) or subplot('Position',[x y w h]).
Behavior of charting functions when the NextPlot property of the Axes object is set to 'replacechildren'Still runsNot applicableCharting functions no longer change most axes properties when the NextPlot property of the Axes object is set to 'replacechildren'.

Data Import and Export

Custom Datastore: Build a customized datastore

Build your own datastore for custom or proprietary data (stored in files or a data stream) using the custom datastore framework. Then, use this custom datastore to bring your data into MATLAB and leverage the MATLAB Big Data capabilities such as tall, MapReduce, and Hadoop®. For more information, see Develop Custom Datastore.

datastore Function: Work with data stored in Windows Azure Blob Storage

You can use data stored on Windows Azure® to create a datastore. Windows Azure Blob Storage (WABS) is an online file storage web service offered by Microsoft. For more information, see Introduction to Windows Azure.

To use Windows Azure with datastore, see Windows Azure Blob Storage.

datastore Function: Access Hadoop HDFS data more easily

You can access Hadoop data more easily by using the hdfs:/// syntax:

ds = datastore('hdfs:///path_to_file/file.ext')
For example, this command creates a datastore for file myData.txt in folder data.
ds = datastore('hdfs:///data/myData.txt')
When you specify location with this syntax, the datastore function uses the Hadoop HDFS™ host name associated with the Hadoop installation that MATLAB is paired with.

FileDatastore Object: Create uniform output from datastore

For vertically concatenated data, you can design your ReadFcn to return a uniform output, in the form of a MATLAB table.

For example, create a FileDastore object and check the value of its new UniformRead property. This property indicates whether multiple reads of FileDatastore return uniform data that can be vertically concatenated. The UniformRead property is set to either true or false.

  • If set to false (default), then the readall method returns a cell array of data where each call to the read method adds new entries into the cell array.

  • If set to true, then readall method returns a table. Therefore, your ReadFcn must return vertically concatenable data else the readall method returns an error.

HDF5 Functions: Create datasets, groups, attributes, links, and named datatypes using non-ASCII characters

HDF5 functions support use of non-ASCII characters for HDF5 datasets, groups, attributes, links, and named datatypes. To create and access non-ASCII data, set the 'TextEncoding' name-value pair to 'UTF-8'. These high-level and low-level functions support the 'TextEncoding' name-value pair:

High-Level Functions

Low-Level Functions

For more information, see Working with Non-ASCII Characters in HDF5 Files.

Web services: Skip server name verification in certificates

To disable certificate server name verification in cases where the server's certificate does not match the URI used to access it, set the VerifyServerName property to false in matlab.net.http.HTTPOptions.

jsonencode Function: Encode NaN and Inf as null

The jsonencode function encodes MATLAB NaN and Inf values in JSON as null.

Compatibility Considerations

To continue encoding NaN as 'NaN', call jsonencode with the 'ConvertInfAndNaN' option set to false.

jsonencode(NaN,'ConvertInfAndNaN',false)
ans =

    'NaN'

Functionality being removed or changed

FunctionalityWhat Happens When You Use This Functionality?Use This InsteadCompatibility Considerations
ncwriteStill runsnetcdf.putVar

The ncwrite function applies attribute conventions _FillValue, scale_factor, and add_offset when writing data of all data types.

If you do not want to apply attribute conventions when you write data to a netCDF variable, use netcdf.putVar.

Using load statements inside a function to load variables from file.

For example:

function loadVar()
     ...
     load data.mat x;
     disp(x)
     ...
end

Warnsnone

Currently, if you use a load statement in a function to load a variable that does not exist, then MATLAB behaves as follows:

  1. Issues a warning 'Variable not found'.

  2. Interprets any subsequent references to that variable, as calls to a path function (with the same name as the variable) if one exists.

For example, consider a file data.mat that has only two variables, a and b. Write a function to load a variable pi from data.mat and include a subsequent call to pi.

function loadVar()
  load data.mat pi; % pi does not exist in data.mat
  pi;
end
Calling loadVar results in a warning. Then, pi in the next line gets resolved to pi on the path.
Warning: Variable 'pi' not found.
> In loadVar (line 2)

ans =

    3.1416

In future releases, if you use a load statement in a function to load a variable that does not exist, then MATLAB:

  1. Issues the warning 'Variable not found'.

  2. Interprets any subsequent references to that variable, as calls to a variable. Therefore, MATLAB returns the error'Undefined function or variable'.

Attempting to load pi from data.mat and a subsequent call to pi, results in a warning and an error.

Warning: Variable 'pi' not found.
> In loadVar (line 2)
Undefined function or variable 'pi'.

Error in loadVar (line 3)
pi

Data Analysis

ischange Function: Detect abrupt changes in data

You can use the ischange function to find local changes in the mean, variance, or linear slope and intercept of array and table data.

islocalmin and islocalmax Functions: Detect local minima and maxima in data

To find local minima and maxima in table or array data, use the islocalmin and islocalmax functions.

rescale Function: Scale data to a specified range

You can scale data in an array to a specific range using the rescale function. For example, rescale(A,1,10) scales the entries of an array A to the interval [1,10].

tall Arrays: Operate on tall arrays with more functions, including fillmissing, filter, median, polyfit, and synchronize

The functions listed in this table add support for tall arrays as inputs. For a complete list of supported functions, type methods tall. For information on usage and limitations, type help tall/functionName. For example, help tall/filter.

binscatterplotscatter
boundspolyfitsplit (for tall arrays of strings)
fillmissingpolyvalsummary (for tall timetables)
filterretime (for tall timetables)synchronize (for tall timetables)
medianrmmissingvertcat

tall Array Indexing: Use subscripted assignment with tall arrays

The subscripted assignment statement A(m,n,p,…) = B adds support for these situations:

  • The right side of the assignment statement B can be a tall array derived from A. For example, with a 3-D tall array A = tall(ones(3,3,3)), you can make assignments such as A(:,:,1) = mean(A,3).

  • The subscripts n,p,... can exceed the dimensions of A, which enables you to grow the array with subscripted assignment for any dimension other than the first (tall) dimension. For example, with a 2-D tall matrix A = tall(rand(1000,3)), you can turn A into a 3-D matrix with A(:,:,2) = 2*A(:,:,1).

tallrng Function: Control random number generator used by tall arrays

Use tallrng in a manner similar to rng to control the random number generator used in certain tall array calculations.

timetable Data Container: Specify whether each variable in a timetable contains continuous or discrete data using the VariableContinuity property

To specify whether timetable variables represent continuous data, you can use the VariableContinuity property. If you specify VariableContinuity and call the retime or synchronize functions, then you do not need to specify a method. Instead, retime and synchronize fill in the output timetable variables using different default methods for continuous, step, or event data. For more information, see the VariableContinuity property of timetable or Retime and Synchronize Timetable Variables Using Different Methods.

mink and maxk Functions: Find the k smallest or largest elements in an array

Finding a specified number of smallest or largest elements in array data is now possible with the mink and maxk functions.

For example, mink(A,5) and maxk(A,5) return the 5 smallest and 5 largest elements of a vector A, respectively.

topkrows Function: Find the k top rows in sorted order for numeric arrays, tables, and timetables

The topkrows function adds support for in-memory numeric arrays, tables, and timetables. Previously, topkrows supported only tall arrays.

Compatibility Considerations

There are a few behavior changes when topkrows operates on tall arrays:

  • When operating on a tall array, topkrows places NaN, NaT, and other missing values at the end of a descending sort. In previous releases topkrows placed missing values at the beginning of a descending sort.

  • topkrows no longer accepts tall cell arrays containing only scalar numeric values as inputs. Use cell2mat to convert the tall cell array of scalar numeric values into a tall matrix before using topkrows.

App Building

App Designer: Create apps with a wide variety of 2-D and 3-D plots

Include a wider selection of 2-D and 3-D plots in your app, such as surfaces and patches. For more information, see Graphics Support in App Designer.

App Designer: Add menus to an app from the Component Library

Add menus to your apps by dragging a menu bar from the App Designer Component Library onto the canvas. Then add and edit your menu items by clicking the + buttons, pressing the Delete key, and typing directly on the menu labels.

App Designer: Specify input arguments when running an app

Define input arguments for your app, and access them in the StartupFcn callback for the UIFigure component. You can use the input arguments to pass data between apps or to set default values in an app. See Startup Tasks and Input Arguments in App Designer for more information.

App Designer: Add a summary, description, and screenshot for app packaging and compiling

Add a name, summary, description, and screenshot for your app. MATLAB provides this information for use in other contexts, such as:

  • The Package App interface

  • The MATLAB Compiler™ interface

  • The file browser details on some operating systems

App Designer: Improved component Properties pane in Code View

The component Properties pane in Code View has an improved layout with richer editing capabilities. For example, toggle buttons are now available for controlling certain properties such as font weight and text alignment.

App Designer: Edit tick labels for gauges, knobs, and sliders directly in the canvas

Now you can change the tick labels for gauges, knobs, and sliders more quickly by editing them directly on the canvas.

uitree and uitreenode Functions: Create trees and tree nodes in apps

Call the uitree and uitreenode functions to display lists of items in a hierarchy within your app.

To display a hierarchy in an App Designer app, call the uitree and uitreenode functions from within a callback, such as the StartupFcn for the UIFigure component. For an example, see Use App Designer to Display Items in a Tree.

The functions only work for App Designer apps or in figures created with the uifigure function.

uiconfirm Function: Create modal in-app confirmation dialog boxes

Call the uiconfirm function to create a modal in-app dialog box that displays a set of options that you define. The function has an output argument that returns the user's selection.

The dialog box can only display in App Designer apps or in figures created with the uifigure function.

Toolbox Packaging: Add App Designer apps to the Apps Gallery upon toolbox installation

When you package a toolbox, MATLAB automatically detects App Designer apps (.mlapp files) in addition to app installer files (.mlappinstall files). If you package these apps or app installer files with your toolbox, they appear in the MATLAB Apps Gallery when a user installs your toolbox. For more information, see Create and Share Toolboxes.

MATLAB Online: Run App Designer apps in MATLAB Online

MATLAB Online™ now supports running apps created in App Designer. Only the Google Chrome™ browser supports this capability. If you want to build an app, you must use App Designer running on a desktop version of MATLAB.

Performance

App Designer: Load apps faster

Loading apps into App Designer is 40% to 60% faster than in R2017a. The time savings becomes more noticeable as the number of components in your app increases.

Execution Engine: Improved performance for vectorized math on CPUs with AVX2​​​

The MATLAB execution engine improves performance of vectorized math on CPUs that support AVX2 instructions, compared to CPUs that support SSE2 or earlier versions of SIMD (Single-Instruction Multiple-Data) extensions.

Live Editor: Run live scripts with loops faster

Live scripts containing loops run significantly faster than in previous releases. In addition, typing and scrolling in live scripts is more responsive.

Hardware Support

Arduino: Wirelessly connect to Arduino boards using low-cost Bluetooth adaptors

MATLAB Support Package for Arduino® Hardware enables you to wirelessly connect to and communicate with Arduino boards over Bluetooth® using low-cost Bluetooth devices such as Adafruit Bluefruit EZ-Link, HC-05, or HC-06. Instrument Control Toolbox software is required to set up Bluetooth communication.

Arduino Setup UI: Set up a connection to your Arduino board over USB, Bluetooth, or Wi-Fi

MATLAB Support Package for Arduino Hardware enables you to use arduinosetup guided interface to set up a connection to your Arduino board over USB, Bluetooth, or Wi-Fi®.

Arduino Plug-In Detection: Discover available Arduino support and examples when plugging a compatible Arduino board

MATLAB Support Package for Arduino Hardware automatically detects compatible Arduino boards plugged into your computer and also shows available Arduino support for MATLAB and Simulink along with examples.

Advanced Software Development

MATLAB Engine API for C++: Run MATLAB code from C++ programs with object-oriented programming support and asynchronous execution

The MATLAB Engine API for C++ provides an interface between the C++ programming language and MATLAB. This API enables C++ programs to launch MATLAB, evaluate MATLAB functions with arguments, and exchange data between MATLAB and C++ programs. For more information, see MATLAB Engine API for C++.

MATLAB Engine API for C++: Pass data between C++ programs and MATLAB using MATLAB Data Array

The MATLAB Data API uses modern C++ semantics and design patterns and avoids data copies whenever possible by using MATLAB copy-on-write semantics.

Java SE 8: MATLAB support, providing improved security and access to new Java features​​​

Java interface supports JRE version Java 8. For more information, see https://www.mathworks.com/support/sysreq/supported-language-interfaces.html.

MinGW 5.3: MATLAB support​​​

MATLAB supports the MinGW®-w64 version 5.3.0 compiler from https://mingw-w64.org for building MEX files and standalone MATLAB engine and MAT-file applications. To download the supported version, search for MinGW from the Add-Ons menu. If you do not install the supported version, then MATLAB displays a warning.

Microsoft Visual Studio 2017: MATLAB support for Microsoft Visual Studio 2017 Community, Professional, and Enterprise editions​

MATLAB supports Microsoft® Visual C++® 2017 Professional, Community, and Enterprise editions for building MEX files and standalone MATLAB engine and MAT-file applications.

Compiler support changed for building MEX files and standalone MATLAB engine and MAT-file applications

SupportCompilerPlatform

Added

Microsoft Visual C++ 2017 Professional, Community, and Enterprise editions

Windows

Added

Microsoft Visual C++ 2015 and 2013 Community and Enterprise editions in addition to continued support for the Professional edition

Windows

Added

Microsoft Visual Studio® 2015 (v140) toolset installed over Visual Studio 2017

Windows

Added

MinGW-w64 version 5.3.0 compiler from https://mingw-w64.org

Windows

Added

Intel® Parallel Studio XE 2017 with Microsoft Visual Studio 2017 for C, C++, and Fortran

Windows

Discontinued

MinGW-w64 version 4.9.2 compiler from TDM-GCC

Windows

Discontinued

Microsoft Visual C++ 2012 Professional

Windows

Discontinued

Microsoft Windows SDK 7.1

Windows

To be phased out

Support for GNU® gcc and gfortran version 4.9 will be discontinued in a future release, at which time new versions will be supported.

Linux

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.

Python Version 3.6: MATLAB support

MATLAB supports the following versions of CPython:

  • Version 2.7

  • Version 3.4

  • Version 3.5

  • Version 3.6

For more information, see Install Supported Python Implementation.

Perl 5.24.1: MATLAB support

MATLAB ships with Perl version 5.24.1.

Compatibility Considerations

If you use the perl command on Windows platforms, see www.perl.org for information about using this version of the Perl programming language.

MATLAB Handle class method: Add a listener for an event without binding the listener to the source object

The listener handle class method adds a listener for an event without binding the listener lifecycle to the object that is the source of the event. For more information, see handle.listener.

Unit Testing Framework: Provide code coverage reports in the Cobertura format for improved continuous integration workflows​​​

You can specify that the code coverage plugin returns code coverage results in the Cobertura format for use within continuous integration systems. Use the 'Producing' name-value pair argument with the forFolder, forPackage, or forFile static method of the matlab.unittest.plugins.CodeCoveragePlugin class.

Unit Testing Framework: Generate HTML report of a test run​​

Create easily readable and navigable HTML reports of your test runs using the producingHTML static method of the TestReportPlugin. For more information, see matlab.unittest.plugins.TestReportPlugin.producingHTML.

Unit Testing Framework: ​​Write tests as live scripts

You can write and execute script-based unit tests using Live Scripts. For more information, see Write Test Using Live Script.

Unit Testing Framework: Specify additional diagnostics to evaluate upon failures using the onFailure​​​​​​ method

To specify additional diagnostics for the testing framework to evaluate when a test fails, use the onFailure method of the matlab.unittest.TestCase class. For more information, see matlab.unittest.TestCase.onFailure.

If you create custom test fixtures, you can specify additional diagnostics for failures during fixture setup and teardown routines. For more information, see matlab.unittest.fixtures.Fixture.onFailure.

Performance Testing Framework: Define multiple measurement boundaries in test methods

To further refine which code to measure, performance tests now support multiple measurement boundaries in a test method. Use multiple, nonnested calls to the startMeasuring and stopMeasuring methods of matlab.perftest.TestCase within your test methods. Measurements from multiple boundaries in the same test method are accumulated and summed. For more information, see startMeasuring.

Mocking Framework: Construct mocks for classes that have Abstract methods with other attributes

You can construct a mock for a class that has Abstract methods and other attributes. For example, you can construct a mock for a class with a method that has Abstract and Static attributes. The mock implements the method as a concrete, Static method. Similarly, methods with Abstract and Hidden attributes are implemented as concrete and Hidden methods. For more information, see Create Mock Object.

Source Control Integration: Show differences from parent files and save copies in Git Branches

In a project under Git™ source control, in the Branches dialog box, you can show differences to parent files and save branches. You can save a copy of the selected files or parent files to examine added or deleted files or to test how the code ran in previous versions. For more information, see Branch and Merge with Git.

Functionality being removed or changed

FunctionalityResultUse This InsteadCompatibility Considerations

Programmatic dependence on specific diagnostic subclass from getDiagnosticFor method of constraint and tolerances

Still runs

Not applicable

Rework code that relies on properties or methods specific to matlab.unittest.diagnostic.ConstraintDiagnostic instances returned from the getDiagnosticFor method of matlab.unittest.constraints classes.

In a future release, diagnostics returned from constraint and tolerance classes in the matlab.unittest.constraints package will be subclasses of matlab.unittest.diagnostics.Diagnostic and might not be instances of matlab.unittest.diagnostic.ConstraintDiagnostic.

Negation of matlab.unittest.constraints.ReturnsTrue constraint (~ReturnsTrue)

Warns

Not applicable

Change the logic for tests that rely on negating the ReturnsTrue constraint.

Generating test suites from a class that derives from a concrete base class that defines methods that reference a TestParameter, MethodSetupParameter, or ClassSetupParameter not defined within the base class

Errors

Define either the:

  • Base class as Abstract using the class-level Abstract attribute. For example, classdef (Abstract) MyTest < matlab.unittest.Testcase.

  • Abstract parameter properties for all parameters used by methods of the class. For example, properties (Abstract,TestParameter).

If your test class inherits from a concrete base class that uses a parameter that is not defined in the base class, MATLAB throws an error.

Invoking TestRunnerPlugin superclass methods more than once

Errors

Not applicable

Custom plugins contain methods that invoke the corresponding TestRunnerPlugin superclass methods exactly once. Rework any custom plugins that invoke the superclass methods more than once. Starting in R2017b, this behavior throws an error.

Setting the event ListenAccess or NotifyAccesst attributes to immutable.

Errors

immutable is not a valid value for these attributes.

In previous releases, setting these attributes to immutable did not cause an error.

Setting the method Access attribute to immutable.

Errors

immutable is not a valid value for this attribute.

In previous releases, setting this attribute to immutable did not cause an error.