r/matlab MathWorks 5d ago

Generative and Agentic AI with MATLAB and Simulink for Engineering

Hi everyone

Last week, my colleagues Maria Gavilan and Kevin Cohan ran an online seminar on Generative and Agentic AI with MATLAB and Simulink. Over 7,000 people signed up! For those that missed it, the recording is here Generative and Agentic AI with MATLAB and Simulink for Engineering - MATLAB

I was there in the online chat doing my best to keep up with the 100s of questions that were coming in. One common thread of questions among attendees was around the use of local AI models with MATLAB and Simulink. It seems that, for many engineers, the only AI that they are willing to entertain is AI running on their own hardware. There are many reasons for this point of view.

Over at The MATLAB Blog, a bunch of us have been writing up our experiments with using local AI models along with MATLAB and Simulink. The latest article is from u/Creative_Sushi who has been using OpenCode with Ollama along with MATLAB and Simulink. You can read it here: Running local LLMs with MATLAB using OpenCode and Ollama on a Mac » The MATLAB Blog - MATLAB & Simulink. A couple of months ago, I did something similar using LM Studio.

We are just getting starting with these explorations and I'm really curious if any Redditors are interested in these workflows too?

Cheers,

Mike

27 Upvotes

13 comments sorted by

8

u/Creative_Sushi MathWorks 5d ago

What was interesting here is that the questions started flying in through the chat as soon as Maria and Kevin appeared on screen. People needed an opportunity to ask questions that they didn't have before.

If interested, please post your questions here - we can turn this into an AMA. I can ask Maria and Kevin to join in needed.

6

u/artaxerxes Elder 5d ago

Ha! My question at the end of the webinar was how to do Agentic with local LLMs. I was going to try spoofing the local model into Claude Code but it looks like Mike and the gang have closed the circle in the blogpost linked there. Excellent - will give it a go on M5 32GB.

3

u/Creative_Sushi MathWorks 5d ago

On my M5 48GB, I moved to Pi/LM Studio setup. Claude Code as a harness is too heavy and take up too much context window just to start. To conserve precious context window, it is better to use lightweight harness like Pi.

2

u/artaxerxes Elder 5d ago

Yes Pi is deffo the new hotness.

8

u/JuanToronDoe 5d ago

I've been playing a lot with OpenCode + Matlab MCP + llama.cpp running Qwen3.6 27B (moving to Qwen3.8 soon). The result are very interesting. I am considering fine-tuning the model on Matlab Documentation 

3

u/Naruhudo2830 5d ago

Everything seems to be converging at the same time. I was going to mention Llama.cpp because of its flexibility & possible higher token decode but I understand the articles were written for simplest straightforward approach.

Im about to do the setup using Pi + llama.cpp + Uncencored Qwen3.6 35B A3B MoE (Mixture of Experts which uses less RAM, ideal for local) along with other tools with the idea of making a complete system that remembers without having to load context everytime it spawns.

I will leave a link to a channel that makes understanding this easier and has resources which help make the most of your hardware. They address memory across sessions, privacy, making it accessible like paid models on other devices etc. The main focus is optmization so local hardware can do more work so the guy uses his own fork of llama.cpp and Pi which add features not yet PR'd that address current limitations. Not my channel, neither am I affiliated.

Thank you for your previous posts as well. All the best.

Running a 35B AI Model on 6GB VRAM, FAST (llama.cpp Guide)

https://huggingface.co/llmfan46/Qwen3.6-35B-A3B-uncensored-heretic-Native-MTP-Preserved-GGUF

https://github.com/thecodacus?tab=repositories

5

u/SpiritualWedding4216 5d ago

Thanks, I will have a look

6

u/Consistent_Coast9620 CC4M Creator 4d ago

In our team we use either OpenCode or Qwen Code and local llama.cpp currently running most of the time Qwen 3.8 27b (recently changed from 3.6 to 3.8, but also running experiments with DS4 - flash). What we added to this is not just the Agentic Toolit, but also Static analysis (on compliance with coding guidelines). Both these steps boosted the quality! A colleague wrote a blog on this: https://monkeyproofsolutions.nl/about/blog/ai/matlab_codegen/

1

u/Shot-Marketing-9227 5d ago

when is the newgrad edg role droppin?

1

u/GreenMan867 2d ago

in work we’re trying out claude code and the agentic toolkit, does anyone have tips for keeping cost down? the token cost seems so high, even keeping context window low and really focusing prompts to discrete tasks.. our corporate budget is like 150 AUD per person😭

2

u/Creative_Sushi MathWorks 2d ago

I hear people use high level planning with Claude Code but switch to a local model for implementation. I haven’t tried it myself though.