Simulink (Matlab) Copilot

35 kaamuli 6 6/13/2025, 6:58:49 PM github.com ↗

Comments (6)

stochtastic · 12h ago
This is very cool, thanks for sharing. There are many industries and academic fields where Matlab has gone out of fashion (I work in one), and my experience has been that there's a lot of over the top negativity about Mathworks products, centering mostly on the license and business model. But I think there's a lack of awareness of just how superior Matlab and Simulink are to all alternatives in some domains. All that to say: don't let the Matlab hate get to you, you're using the right tool for the job.
steamrolled · 8h ago
The complaints about licensing seem a bit weird given that the company actually accommodates hobbyists. They have a $100-something perpetual home license that doesn't require internet access.

Most other vendors of niche "pro" software just give the middle finger to hobbyists and want you to pony up thousands of dollars for an annual subscription.

I think it's perfectly OK to say "I don't need this, open-source tools work for me". Just like you can use KiCad instead of Cadence for PCB design. But getting angry at Mathworks for wanting money from commercial users seems weird.

inamberclad · 5h ago
I'm frustrated that they push their product on undergrad engineering classes so heavily. Except for a few poorly taught weeks of C++, most of my classmates never leaned anything else. Admittedly, Matlab is a very good product for modeling and learning about controls, but they use this advantage to make sure all the fresh undergrads only know how to program in their product.
mrchucklepants · 10h ago
There really is no alternative to Simulink. When you add Simulink Compiler and Embedded Coder, you can do some amazing things. If I am doing anything else, I use Python.
kaamuli · 13h ago
Before I start - Yes, I know the differential equation in the video is wrong. I’ve already fixed it by tweaking the prompt and the script so the inputs depend on what’s being asked. The original issue was that blocks like Sum were being pasted in without matching the right number of inputs and outputs.

I’m a 2nd-year aero-engineering student at Imperial College London, I enjoy problem solving (did BPhO - gold and UKMT Gold) I'm a full-stack dev (or atleast trying to be lol) who hacked together Bloxi, an AI copilot that sits on top of Simulink and turns plain-English prompts into working control-system models and can easily debug them in real time. I felt the pain myself this term, watching top-tier students burn hours wiring blocks instead of engineering. With today’s multimodal LLMs finally able to “see” diagrams, this is the first moment an assistant like Bloxi can exist and the fastest way to give millions of engineers the same productivity leap coders just got.

I built this mainly to get comfortable with LLMs and “prompt-engineering,” and I think I’ve hit the point where I’m done tinkering—especially now that MathWorks have announced they’re working on their own version. So I figured I’d share what I’ve got in case anyone wants to take it further and also just to like give it out to the world innit.

How it works

Two scripts + simple backend: 1. One builds the Simulink model. 2. The other handles the chat + simple UI. 3. Backend that glues together the OpenAI API and frontend

Drop in your own OpenAI API key and you’re off. I used it to debug and build a few uni-project models, and it’s been surprisingly handy.

At first it just spat out a finished Simulink file, but I wanted that ChatGPT “walk-through” vibe make it feel 'magical'. So I added a couple of for loops: one to drop in blocks step-by-step, and another to wire them up.

Since raw code isn’t visible in Simulink (to the best of my knowledge), within one of my scripts I had it walk through the simulink file and screenshot each stage leveraging the fact openAI's API is multimodal, pipe them through the LLM, and let it spot inconsistencies. Works better than I expected. Perhaps someone can do better or find a better way?

Youtube video of me using it: https://youtu.be/TX0fviaFSyg

Here’s the GitHub link if you want to play with it, poke around or build on it: https://github.com/Kaamuli/Bloxi

To use download & open scripts then just do openChatbox().

mrchucklepants · 10h ago
Nicely done. Simulink really needs something like this.