MATLAB® Interface for Databricks® enables engineers and data scientists to develop, scale, and deploy MATLAB and Simulink® workflows directly on Databricks, operationalizing algorithms and simulations in production pipelines and digital twins.
| Workflow | What it solves | Learn more |
|---|---|---|
| Query Databricks data | Read Delta tables from MATLAB using SQL via JDBC or ODBC — no Spark™ knowledge needed. | JDBC · ODBC |
| Develop with Databricks Connect | Run Spark operations interactively from MATLAB, filter and sort large datasets on the cluster, then pull results locally for analysis. | Databricks Connect |
| Deploy MATLAB to Spark | Compile MATLAB functions to Python® wheel files with MATLAB Compiler SDK™ and run them as jobs on a Databricks cluster — no desktop in the loop for production. | Job Workflow |
| Manage Databricks resources | Create and control clusters, upload files to Unity Catalog volumes, manage secrets, execute SQL, and run jobs — all from MATLAB scripts. | REST APIs |
| Run MATLAB on Databricks | Run MATLAB Desktop or Runtime directly on a Databricks cluster in Docker® containers, accessed via a browser. | Reference Architecture |
MathWorks Products (mathworks.com)
Requires MATLAB release R2024b or newer
- MATLAB Compiler SDK (optional, required when deploying MATLAB to Spark)
- Database Toolbox™ (optional, required for JDBC/ODBC connections)
- Databricks account using runtimes >= 13.3
- Python 3.10, 3.11, or 3.12 (required by Databricks Connect)
- Docker (required for MATLAB on Databricks and runtimes >= 17)
- Databricks JDBC or ODBC drivers (required by MATLAB Database Toolbox)
Installation instructions
- Under "Assets" of a release, download the toolbox package
.mltbxfile. - Start MATLAB.
- In the Current Folder browser, navigate to the
.mltbxfile. - Right click on the
.mltbxfile and select "Install".
Paste this into the MATLAB Command window:
websave(fullfile(tempdir,"databricks.mltbx"),"https://github.com/mathworks/MATLAB-Interface-for-Databricks/releases/latest/download/matlab-databricks.mltbx");
matlab.addons.install(fullfile(tempdir,"databricks.mltbx"));For full cluster setup instructions, see the MATLAB on Databricks Reference Architecture. Follow the instructions in the Connect to MATLAB notebook to install the package.
- In MATLAB, run
setup. This will guide you through configuring your Databricks workspace URL, authentication, and connection settings. - Configure authentication — see Authentication for supported methods (PAT, OAuth, etc.).
- Try an example: Databricks Connect NYC taxi or JDBC workflow.
For detailed setup instructions, see Setup.
| Example | Description |
|---|---|
| Databricks Connect — NYC Taxi | Query and analyze NYC taxi data using Spark from MATLAB |
| Databricks Connect — Artifacts | Work with Databricks artifacts |
| Machine Learning | Train and deploy ML models on Databricks |
| Simscape™ Simulation | Deploy Simscape models to run at Spark scale |
| Simulink 3DoF | Deploy a Simulink suspension model to Databricks |
| App Designer | Build a MATLAB App to browse Databricks clusters |
| Tasks | Run MATLAB batch tasks on Databricks |
See all examples in Software/MATLAB/examples/.
To learn how to use this in testing workflows, see Examples.
The license is available in the LICENSE.md file in this repository.