The MATLAB Blog

Practical Advice for People on the Leading Edge

The latest version of MATLAB: R2024b has just been released

Representing the culmination of millions of person-hours of work conducted by thousands of engineers around the world, the latest release of MATLAB is always something of a celebration here at MathWorks. R2024b is no exception with thousands of new features, updates, improvements and bug fixes across all of our products.
While the full release notes tell you the full, unabridged story, this blog post takes you on a tour of some of my personal highlights.

Structural changes

First version of the MATLAB package manager (mpm) The The MATLAB package manager helps with distributing and installing MATLAB code. With this initial release, you can:
  • Define a collection of MATLAB code as a package, with dependencies on other packages
  • Create a repository of MATLAB packages on a shared file system
  • Programmatically install packages and their dependencies
  • Programmatically manage the installed collection of packages
We think this release is enough to get many users started with package management for their MATLAB code, but there are a few key limitations we plan to address over the next handful of releases:
  • We don't yet support a public package repository (e.g. the File Exchange) or private repositories with tools like Artifactory.
  • We haven't yet fully integrated packages with MATLAB Projects or toolbox (MLTBX) files.
I invite you to explore the documentation for now and expect a more in-depth article here in the near future.
(Beta) Plain text live scripts - Ever since live scripts were introduced in 2016, they used the .mlx file format which is a binary format. This is great for representing mixed text, images, code, output etc but it does have some issues. The biggest drawback of this design choice is that they don't work well with version control systems such as git. You also can't read them outside of MATLAB using text editors such as Visual Studio Code (even with the MATLAB extension). All that changes now that live scripts can also be saved in a plain text, markdown-like format. This is a beta release and you'll need to install and use the new desktop beta to access this functionality. I'll be doing a deep dive into all of this later this year.
Farewell to the Help Browser - Before 2024b, when you opened the documentation from MATLAB, it opened in the MATLAB help browser. Now, it opens using your system browser. This simplifies the update process and allows us to serve high quality doc on the latest platform. We thank the MATLAB Help Browser for its many years of service and hope it enjoys its retirement years. This is the latest of a sequence of structural changes to how documentation is installed and accessed in MATLAB. Expect a deeper dive soon.

Accessibility

(Beta) Improved screen reader support - Last year I introduced you to the beta version of the new MATLAB Desktop. Back then, my focus was on dark mode support but, as you might expect from the future of the MATLAB desktop, there is a lot more to it than that. Along with the updates to live scripts discussed above there are a range of other improvements, among which is improved support for screen readers. This has received some great feedback from early testers. If you haven't tried the new MATLAB desktop beta (or even if you have!), now is the time as it has seen many improvements recently.
Data sonification - Many statisticians and data scientists will implore you to visualize your data before you start to analyze it. For some people. however, visualization is not an option. This is where the new sonify function comes in, allowing you to hear your data instead.

ODE developments continue

Support for solving ordinary differential equations (ODEs) in MATLAB is going through something of a renaissance at the moment. R2023b introduced an entirely new and modern way of setting up and solving ODEs in MATLAB. This was built upon in R2024a to provide support for the computation of parameter sensitives and new solvers were introduced based on the popular SUNDIALS solver suite from Lawrence Livermore Labs.
In R2024b the new interface has seen several incremental updates. You can now specify an ODE as implict in the new interface and there is also an option to activate a stiffness detection heuristic. We've also provided options to set the minimum step size for several ODE solvers via the SolverOptions property of the ode object.
Last but not least is the new Live Task for the interactive solution of systems of ordinary differential equations. Live tasks are graphical user interfaces (GUIs) that allow you to explore the mathematics in a point-and-click fashion with the added bonus that you can generate the code that does the same analysis after you've finished.
Untitled Project.gif

Close enough for all practical purposes

The favorite new mathematical function of several MathWorkers is the simple looking isapprox. Floating point math is more complicated than many people realize and so even something as 'simple' as the question 'are these two numbers equal' can have a complex answer. We end up asking a different question 'Are these two numbers approximately equal?' but what, exactly, do we mean by that? It's surprisingly easy to get this wrong. isapprox helps ensure you get it right.

More plots in base MATLAB

The MATLAB Graphics and App Building blog will have more details on what's new in this area but I wanted to highlight two new plots in base MATLAB. violinplot and compassplot.

Raspberry Pi 5 support in MATLAB

No, I don't mean running MATLAB directly on Raspberry Pi! The support I'm referring has three components
  • The ability to communicate with a Raspberry Pi remotely from a computer running MATLAB to acquire data from sensors and imaging devices to process later in MATLAB. This even works via your web browser in MATLAB Online.
  • The ability of MATLAB Coder to generate C code from your MATLAB code and deploy that onto Raspberry Pi hardware.
  • Communication with other hardware through the GPIO, serial, I2C, and SPI pins of the raspberry pi.
This is all provided by the MATLAB Support Package for Raspberry Pi Hardware which has been around for a long time now. The news here is that support has been extended for the Raspberry Pi 5 that was released last year. A great excuse for me to get one.

The Segment Anything Model (SAM) comes to the MATLAB Image Labeler app

This update comes from Computer Vision Toolbox and relates to the popular Image Labeler app that helps you quickly generate ground-truth labels for data in a collection of images. This is useful for those who need to train their own machine learning models based on their own data.
The Image Labeler app now has support for the Segment Anything Model, a state-of-the-art image segmentation model that uses deep learning neural networks to accurately and automatically segment objects within images without requiring training. More details at Automatically Label Ground Truth Using Segment Anything Model.

full-sam-segmentation.gif

Medical image segmentation in MATLAB with the Medical Segment Anything (MedSAM) Model

Continuing the theme of image segmentation, an important topic for many of our users, we have this update in Medical Imaging Toolbox which allows you to interactively segment objects in medical images using deep learning.
24b_rn_medsam_gif.gif
This functionality makes use of the extremely new MedSAM model which extends the applicability of SAM to the medical domain, enabling accurate and efficient segmentation of medical images. While SAM is trained on the SA-1B Dataset, MedSAM is trained on a large-scale medical image data set with over 1.5 million image-mask pairs, covering several imaging modalities and cancer types. Check out Get Started with Medical Segment Anything Model for Medical Image Segmentation for more details.

MATLAB dictionaries go multi-lingual: Python, C/C++ and .NET

In one of the earliest posts on The MATLAB Blog, I introduced you all to the new dictionary datatype in MATLAB. There has been a lot of work on this since then on multiple fronts, from performance to additional ease of use improvements. I promise I'll bring you fully to date at some point but for now I wanted to highlight the multi-lingual support we have for MATLAB dictionaries.
One of the major new improvements in MATLAB Coder for R2024b is that fact that it now supports C/C++ code generation for MATLAB functions that use dictionaries.
Over in the Python world we have improved support for the interoperability between Python and MATLAB dictionaries in R2024b while support for .NET Dictionaries has been around since R2023a!

New deep learning examples

The field of deep learning moves extremely quickly and one of the ways that I keep up is to read and work through the hundreds of MATLAB Deep learning examples in the documentation. Each one is effectively a complete article that brings you to speed in a specific area. R2024b brings you a bunch of new and updated ones

What did I miss? What's your favorite new feature?

By one internal measure, there are over 1900 updates across all products in this new release, only a tiny fraction of which I've discussed here. Feel free to explore the full release notes and let me know what you're most excited about in R2024b
|
  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。