{"id":19129914,"url":"https://github.com/mathworks/matlab-engine-for-python","last_synced_at":"2026-04-22T00:01:25.764Z","repository":{"id":41867254,"uuid":"479453014","full_name":"mathworks/matlab-engine-for-python","owner":"mathworks","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-16T18:57:04.000Z","size":128,"stargazers_count":92,"open_issues_count":28,"forks_count":12,"subscribers_count":4,"default_branch":"R2025a","last_synced_at":"2026-04-16T20:25:43.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-08T15:56:37.000Z","updated_at":"2026-04-15T03:20:11.000Z","dependencies_parsed_at":"2023-02-06T07:40:29.068Z","dependency_job_id":"b3fa7a8c-812e-44c8-9c75-e7620acb0d38","html_url":"https://github.com/mathworks/matlab-engine-for-python","commit_stats":{"total_commits":45,"total_committers":6,"mean_commits":7.5,"dds":0.4,"last_synced_commit":"6fbf1c78f02910e71ce14f3a49f20a634f653509"},"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"purl":"pkg:github/mathworks/matlab-engine-for-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fmatlab-engine-for-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fmatlab-engine-for-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fmatlab-engine-for-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fmatlab-engine-for-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathworks","download_url":"https://codeload.github.com/mathworks/matlab-engine-for-python/tar.gz/refs/heads/R2025a","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathworks%2Fmatlab-engine-for-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32115216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T06:09:00.649Z","updated_at":"2026-04-22T00:01:25.707Z","avatar_url":"https://github.com/mathworks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MATLAB Engine API for Python\n\nThe MATLAB\u0026reg; Engine API for Python\u0026reg; provides a package to integrate MATLAB functionality directly with a Python application, creating an interface to call functions from your MATLAB installation from Python code. \n\n---\n## Requirements\n### Required MathWorks Products\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n* MATLAB release R2025a\n\n### Required 3rd Party Products\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n* Python 3.9, 3.10, 3.11, or 3.12\n    * Supported Python versions by MATLAB release can be found [here](https://www.mathworks.com/support/requirements/python-compatibility.html).\n\n---\n\n## Install\n\n### Windows\nMATLAB Engine API for Python can be installed directly from the Python Package Index.\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n```bash\n$ python -m pip install matlabengine==25.1.2\n```\n\n\n\n### Linux\u0026reg; \nPrior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, Linux installs MATLAB at:\u003cbr\u003e\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n```/usr/local/MATLAB/R2025a```\n\nWhen MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to the environment variable LD_LIBRARY_PATH. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).\n\n```bash\n# in .bashrc\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\u003cmatlabroot\u003e/bin/glnxa64\n```\n\n```bash\n# in .tcshrc\nsetenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:\u003cmatlabroot\u003e/bin/glnxa64\n```\n\nMATLAB Engine API for Python can be installed directly from the Python Package Index.\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n```bash\n$ python -m pip install matlabengine==25.1.2\n```\n\n### macOS\nPrior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, macOS installs MATLAB at:\u003cbr\u003e\n\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n```/Applications/MATLAB_R2025a.app```\n\nWhen MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to the environment variable DYLD_LIBRARY_PATH. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).\n\n```bash\n# in .bashrc\nexport DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:\u003cmatlabroot\u003e/bin/maci64\n```\n\n```bash\n# in .tcshrc\nsetenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:\u003cmatlabroot\u003e/bin/maci64\n```\n\nMATLAB Engine API for Python can be installed directly from the Python Package Index.\n\u003c!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) --\u003e\n```bash\n$ python -m pip install matlabengine==25.1.2\n```\n\n---\n\n## Getting Started\n* Start Python.\n* Import the ```matlab.engine``` package into the Python session.\n* Start a new MATLAB process by calling ```start_matlab```. The ```start_matlab``` function returns a Python object which enables you to pass data and call functions executed by MATLAB.\n\n```python\n\u003e\u003e\u003e import matlab.engine\n\u003e\u003e\u003e eng = matlab.engine.start_matlab()\n\u003e\u003e\u003e eng.sqrt(4.0)\n2.0\n```\n\n* Call either the ```exit``` or ```quit``` function to stop the engine. Exiting Python with an engine running stops the engine and its MATLAB processes.\n\n```python\n\u003e\u003e\u003e eng.quit()\n```\n\nSee [Start and Stop MATLAB Engine for Python](https://www.mathworks.com/help/matlab/matlab_external/start-the-matlab-engine-for-python.html) for advanced startup examples.\n\n---\n\n## Examples\nYou can call any MATLAB function directly and return the results to Python. \n```python\n\u003e\u003e\u003e eng.plus(2, 3)\n5\n\u003e\u003e\u003e eng.isprime(37)\nTrue\n\u003e\u003e\u003e eng.gcd(100.0, 80.0, nargout=3)\n(20.0, 1.0, -1.0)\n```\nSee [Call MATLAB Functions from Python](https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-python.html) for more usage examples.\n\n---\n\n## Limitations\nLimitations of the MATLAB Engine API for Python can be found [here](https://www.mathworks.com/help/matlab/matlab_external/limitations-to-the-matlab-engine-for-python.html).\n\n---\n\n## Troubleshooting\nSee [Troubleshoot MATLAB Errors in Python](https://www.mathworks.com/help/matlab/matlab_external/troubleshoot-matlab-errors-in-python.html) for troubleshooting assistance.\n\n---\n\n## License\nThe license is available in the LICENSE.txt file within this repository.\n\n---\n\n## Support\nTechnical issues or enhancement requests can be submitted [here](https://github.com/mathworks/matlab-engine-for-python/issues). \n\n---\n\nCopyright \u0026copy; 2022 MathWorks, Inc. All rights reserved.\n\nLinux\u0026reg; is the registered trademark of Linus Torvalds in the U.S. and other countries.\n\nMac OS is a trademark of Apple Inc., registered in the U.S. and other countries.\n\n\"Python\" and the Python logos are trademarks or registered trademarks of the Python Software Foundation, used by MathWorks with permission from the Foundation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks%2Fmatlab-engine-for-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathworks%2Fmatlab-engine-for-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks%2Fmatlab-engine-for-python/lists"}