Generate unit-tested ChatGPT MATLAB codes

版本 1.0.2 (4.1 MB) 作者: Duncan Carlsmith
Generates and tests multiple MATLAB scripts generated by OpenAI's ChatGPT.
200.0 次下载
更新时间 2023/4/1

查看许可证

This Live Script generates multiple MATLAB Live Scripts with a "plain English" prompt using the ChatGPT API. It extends of the code Generate MATLAB Code Using ChatGPT API to generate multiple codes and unit tests each one for executability. The number of trials is selectable. One can break when a first successful code passes an "able to execute" minimal test, illustrating just what might be possible. More sophisicated testing and script creation may be added using MATLAB's text scan and manipulation tools.
This script repeatedly prompts OpenAI's API for ChatGPT to ask for MATLAB code, and writes each code to a .m file in the default folder which may be opened and saved as a .mlx.
Each time ChatGPT is called, it responds with a different script. The script may or may not generate a figure. It may or may not execute due to a minor syntax error. This script can be used to filter out buggy responses so the user to focus on more important things.
To use this script, open a free account and and receive an API secret key at https://platform.openai.com/account/api-keys.

引用格式

Duncan Carlsmith (2024). Generate unit-tested ChatGPT MATLAB codes (https://www.mathworks.com/matlabcentral/fileexchange/125565-generate-unit-tested-chatgpt-matlab-codes), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2022b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

GenerateUnitTestedMATLABCodesUsingChatGPT

版本 已发布 发行说明
1.0.2

Link to related scripts

1.0.1

cosmetic improvement

1.0.0