Access Mathematica and ChatGPT-generate MATLAB code via APIs

Access Wolfram Alpha and ChatGPT-generate corresponding MATLAB code.


Updated 1 Apr 2023

View License

This Live script illustrates how to query Wolfram Alpha via its API and examine plain text and MathML responses with MATLAB. It also passes Mathematica plain text formulae to ChatGPT via OpenAI's API to generate MATLAB scripts and unit tests them, automating an otherwse laborious manual process.
This script incorporates code from Generate unit-tested ChatGPT MATLAB codes on Mathworks File exchange to consume Wolfram Alpha query responses.
To get started, you must first register and obtain an AppID from Wolfram Alpha. To generate MATLAB code, you will need a ChatGPT access key as well. Wolfram Alpha API access is described at Place your keys in local files as described in the code.

Cite As

Duncan Carlsmith (2023). Access Mathematica and ChatGPT-generate MATLAB code via APIs (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!


Version Published Release Notes

Add link.