Matlab users coming from other languages will benefit from the functionality contained within this user-developed, unofficial "stdlib" standard library of functions. These system, filesystem, and HDF5 / HDF4 / NetCDF functions are used by numerous independent projects.
The self-tests can be run from the top matlab-stdlib/ directory.
Matlab R2022b and newer:
buildtool testMatlab R2017a and newer:
test_mainOur functions that aren't possible in native Matlab code are implemented using Matlab's no-compile external language interfaces. The API listing "backend" column tells which functions have selectable backend implementations. By default, when the "backend" is not specified to a function having selectable backend, the algorithm searches for the first available backend and uses that.
Matlab external backends include:
- Java: all supported Matlab releases
- Perl: Matlab R2018a and newer. This uses a system() call to Perl.
- Python: Matlab R2022b and newer.
stdlib.has_pythonchecks that the Python version set bypyenv()is compatible with the Matlab release. If there is a problem with Python on a particular Matlab install,stdlib.has_python(false)disables the Python backend for that Matlab session. - System shell calls: all supported Matlab releases. As a backup when the platform doesn't have the primary (faster) methods available, the system shell can be called for some functions.
- .NET as described below.
.NET support in MATLAB when a compatible .NET SDK is installed includes:
- Windows: all supported Matlab releases, installed from
winget search Microsoft.DotNet.SDK - Linux or macOS: R2024b and newer
For macOS, brew install dotnet and then in Matlab edit(fullfile(userpath, 'startup.m')) and add the lines
setenv('HOMEBREW_PREFIX', '/opt/homebrew')
setenv('DOTNET_ROOT', [getenv('HOMEBREW_PREFIX') '/opt/dotnet/libexec'])Many matlab-stdlib functions work in GNU Octave.
To use matlab-stdlib HDF5 functions in GNU Octave requires the hdf5oct package.
pkg install hdf5octThen when wanting to use HDF5 functions, first do:
pkg load hdf5octTo use matlab-stdlib NetCDF functions in GNU Octave requires the netcdf package.
pkg install netcdfThen when wanting to use NetCDF functions, first do:
pkg load netcdfStdlib for Matlab was partly funded by NASA NNH19ZDA001N-HDEE grant 80NSSC20K0176.