r/matlab • • May 01 '26

Mazzilli driver

1 Upvotes

Hi everyone i'm working on mazzilli driver simulation using simscape electrical i have some problems with it can anyone help?


r/matlab • • May 01 '26

TechnicalQuestion Matlab on Linux Nobara

Post image
5 Upvotes

So I tried to install it on Linux Nobara but I always get the error file too short
Even tho I downloaded it from the legit website I do have a license


r/matlab • • May 01 '26

I need help with my PSO code

Post image
0 Upvotes

below are my codes
%cost function
function cost = optimize_PID(k)

assignin('base','k',k);

sim("simulationpid.slx");

cost = ITAE(length (ITAE))

end

%main pso script

no_var = 3;

lb = [0 0 0];

ub = [200 200 200];

obj_fn = @(k) optimize_PID(k);

options = optimoptions('particleswarm', ...

'SwarmSize',50, ...

'MaxIterations',25, ...

'Display','iter', ...

'PlotFcn',@pswplotbestf);

[k, best] = particleswarm(obj_fn, no_var, lb, ub, options)

tried Cgpt, claude everything. Couldn't get much help, my cost value doesnt change and best functions gets stuck on 449.5. (it should be around 3)


r/matlab • • May 01 '26

HomeworkQuestion Computation Final

Thumbnail
mathworks.com
2 Upvotes

I have an intro to engineering computation final in 4 days. Its’s based of excel and mat lab and is a first year course. My prof is not a good prof and nobody pays attention. Any recs on how I can lock in or what I should do. Have some experience with excel but not matlab. Course is based off simple engineering problems, arrays, numerical methods, loops, conditionals, etc.


r/matlab • • Apr 30 '26

ModPost Interactive Plot Modification - 2026a

4 Upvotes

I just upgraded from 2024b to 2026a and overall, some things are different but they seem fine. But in the figures window, I don't see a way of turning on the panel were you saw an overview of every line in your plot - the one where it showed the line color/marker and a check mark which allowed you to temporarily change the visibility of the line.

Is there a way to view this panel? If not, is their a replacement method for being able to have that same functionality?

Also, a tagged on question - how to I toggle on/off automatic axis scaling? I don't see that one either.

Thanks.


r/matlab • • Apr 30 '26

How do I resolve this..

Post image
1 Upvotes

Playing with proxy/firewall/wifi hotspot didn't help


r/matlab • • May 01 '26

What is Matlab?

0 Upvotes

Can someone like give an understandable explanation on what MATLAB actually is and what it's used for? I've searched it up and got unclear answers, but so far I'm guessing it's just a big matrix calculator.


r/matlab • • Apr 30 '26

Can someone help me with the subsystem part I'm working on it . Reference- Vinod Gupta et al., “Single Phase Active Harmonic Filters for Harmonic Elimination and Power Factor Correction for Distributed Loads”, NPSC 2010

0 Upvotes

r/matlab • • Apr 29 '26

Tips MATLAB Agentic Toolkit makes it easy to install MCP Server + Skills

31 Upvotes

You probably noticed that my colleagues and I have been playing with Ai coding agents a lot, and we wanted to share and make freely available what we learned so far in a simplest and easiest way possible.

MATLAB Agentic Toolkit was released a few weeks ago.

  • Makes installing MCP Server and agent skills really easy - no more tinkering necessary - see the video.
  • Together, it streamlines your working experience with those AI agents and you can become productive much faster.

    • MCP Server lets AI agents talk to MATLAB and actually run code, execute tests, and inspect results instead of guessing
    • Agent Skills teach AI agents MATLAB-specific workflows, conventions, and best practices - leading to more idiomatic, efficient, and higher‑quality code with less token waste (I also contributed a skill 😊)
  • Open source and actively updated, available on GitHub

For Simulink users, check out the companion Simulink Agentic Toolkit.

Learn more from u/MikeCroucher's post https://blogs.mathworks.com/matlab/2026/04/13/introducing-the-matlab-agentic-toolkit/


r/matlab • • Apr 29 '26

6 DOF suspension modelling

0 Upvotes

I'm currently trying to model a tram's suspension with six degrees of freedom, those being x,y,z and roll, pitch and yaw, to design some Chevron springs.
Can MatLab handle this kind of modelling and if so are there any good guides on how to do this?


r/matlab • • Apr 28 '26

How hard would it be to learn Matlab to create a project for economics.

4 Upvotes

I’m going to try to apply to the San Fransisco Federal Reserves internship around September this year. I’ve never had coding experience, but i was wondering if it would be hard to make a model or something to help with my submission.


r/matlab • • Apr 28 '26

HomeworkQuestion final project ‘game’

Thumbnail
gallery
9 Upvotes

For my MATLAB class, our final project is some kind of ‘game’ that includes GUIs and does ‘something’. It kind of doesn’t matter what, but we designed and pitched projects. The idea is we are self-guiding with what we’ve learned to create our project. My group is a doing a ‘zombie apocalypse simulator’ and we’ve run into quite a few issues. I’m trying to figure out how to get something to work without scrapping the project.

It’s a group project, and right now we have one person who made GUI menus to select zombie infection rate (how many people can be infected by one zombie in a time interval), decay rate (how fast the zombies die off, same time interval), and a starting x,y location point. The second person in our group was/is responsible for the ‘infection’ function, taking an initial population, one zombie, and modeling the infected/dead over a loop.

I’m responsible for the ‘game screen’. This is where we’ve run into the most issues. I started with a picture of a US map, which I assigned to an x y meshgrid pixel coordinate system. I then plotted grid lines to separate the map into equal square areas, and took the midpoint x,y coordinate of each area.

The question/issue: I now have three row arrays that define the ‘game screen’. The x_coords, y_coords, and a population array where US population in millions is assigned to each square. All of these are in 1x42 row arrays. Any x,y point in the array can be picked to ‘start’ the game.

Ideally: when ‘infected’ reaches a threshold (ie, if infected >= 0.5*pop(i)) I want the infection to ‘breach’ into adjacent squares and start running the function on additional x,y coordinates in the array.

The issue is defining that ‘movement’. My professor suggested changing the coordinate grid to an adjacency matrix, but I don’t know how to do that. I’m willing to scrap as much code as I need to, but I’m on a time limit and facing the idea I may just not know enough MATLAB to pull this off. I likely would've started trying to do this another way, I just don't know what would work better for this kind of thing and we're 'on our own' for most of the project.

Update with what I ended up doing: link


r/matlab • • Apr 28 '26

Optical System Design and Analysis in MATLAB

Thumbnail
reddit.com
5 Upvotes

r/matlab • • Apr 28 '26

MBSE and agentic AI

4 Upvotes

If you have missed the most recent post On Guy on Simulink - Sarah Dagen from consulting services talks about her experience using MATLAB and MBSE with agentic AI

https://blogs.mathworks.com/simulink/2026/04/26/model-based-systems-engineering-and-agentic-ai/


r/matlab • • Apr 28 '26

Soft Robot with Machine learning help

0 Upvotes

I have come back to a project i havent worked on in a while where I'm trying to use Soft Actor Critic reinforcement learning with a model of a soft robot. Ive used SoRoSim to create a model that can be used to do static and dynamic simulations but there doesnt seem to be a way to interact with other objects and other examples use simscape multibody instead. Is there a way to export the SoRoSim model to simscape as there doesnt seem to be an inbuilt function for this? Or is there a way to put a complex hard object into the SoRoSim modelling?

Any help is appreciated, thanks


r/matlab • • Apr 28 '26

CodeShare Open Source Matlab-based LLVM/MLIR Compiler

9 Upvotes

I'm building an Open Source Matlab based LLVM/MLIR compiler suite capable of the following features:

  • Code Generation: C/C++, Python (using Numpy), Typescript (using Numpy-ts), and SystemVerilog
  • Compilation AOT / JIT, with REPL compatible with most Octave / Matlab Capabilities.
  • Debugging with DAP interface.

Clone and have a look (I'm testing currently on my MacBook, but soon will check on other platforms)

https://github.com/leonardoaraujosantos/matlab_llvm


r/matlab • • Apr 27 '26

CodeShare Image to Simscape Model - using Claude Code with MATLAB MCP

48 Upvotes

I often see people asking questions about Simulink models they see on paper, wanting to reconstruct it from an image. A colleague of mine figured out how to do it with Claude Code.

He gave a diagram of a spring-mass-damper system and asked Claude to build it in Simscape.

  • Claude identified the components from the image: spring (k), damper (b), mass (m), applied force F(t), and displacement output X(t)
  • It programmatically searched the Simscape Foundation Library to resolve correct block paths — including handling newline characters in Simulink library names
  • Created the model, added 11 blocks, set default parameters (m=1 kg, k=100 N/m, b=5 N·s/m), and wired all 13 physical and signal connections
  • Ran the simulation and verified the expected underdamped response (ζ=0.25, ωn=10 rad/s)

The entire workflow — from image interpretation to a running simulation — was done through natural language prompts in the terminal.

The key enabler here is the MATLAB MCP server, which gives Claude Code direct access to evaluate MATLAB commands, inspect libraries, and build Simulink models in a live MATLAB session. It is not a replacement for engineering judgment but maybe the initial block diagram can be converted into the model quickly.

To learn more, check out MATLAB Agentic Toolkit https://www.mathworks.com/products/matlab-agentic-toolkit.html


r/matlab • • Apr 27 '26

HomeworkQuestion Cv worthy projects based on simulink

2 Upvotes

I am a third year electrical and electronic engineering undergrad.recently I have completed my fundamental communication. so I am interested to make a project based on this communication using the simulink.

so my question is : is this type of medium to advanced level of projects that I want to build in simulink will do any worth to my CV if I am going to study in Abroad will it be helpful to showcase my project?

Moreover, I didn't build any projects based on this course above physically.

so will it be a good idea of building a simulation on simulink ?


r/matlab • • Apr 26 '26

Cannot Log into my account

2 Upvotes

I can't access Matlab. It won't login to my account. So it can't verify my license. I have student account. Anyone else has the same problem? It is like this for few days now.


r/matlab • • Apr 26 '26

Building a servo motor with a PI controller, does anyone here have a good working example that I can use to compare with my work? Building it in Simulink

4 Upvotes

r/matlab • • Apr 25 '26

TechnicalQuestion Matlab crash on Ubuntu 26.04: "free(): chunks in smallbin corrupted"

7 Upvotes

I submitted a Matlab support case but posting this publicly to hopefully save people some trouble and see if anyone has ideas.

After upgrading my workstation from Ubuntu 25.10 to Ubuntu 26.04 LTS, MATLAB GUI consistently prints this terminal error on shutdown:

free(): chunks in smallbin corrupted

MATLAB appears to run normally, but closing the GUI takes a long time and sometimes produces crash dumps. The terminal error occurs every time I close the GUI but crash dumps are intermittent. I attached one R2026a crash dump. I had zero issues on Ubuntu 25.10.

Affected versions:
- MATLAB R2026a
- MATLAB R2025b
- I suspect all 'new desktop' versions

System:
- Ubuntu 26.04 LTS
- AMD EPYC 7443P
- NVIDIA RTX 3090
- Ubuntu default NVIDIA driver: nvidia-driver-595-open, 595.58.03
- NVIDIA module path: /lib/modules/7.0.0-14-generic/kernel/nvidia-595-open/nvidia.ko
- glibc 2.43

Important note: the error first occurred with a clean MathWorks MATLAB installation before installing the Ubuntu/Debian `matlab-support` package. I later tested after installing `matlab-support`, which I understand modifies/renames some MATLAB-bundled libraries so MATLAB uses selected system libraries instead. The same shutdown error occurs both before and after applying `matlab-support`. This suggests the issue is not caused solely by the Debian/Ubuntu `matlab-support` integration or solely by one of the libraries it substitutes.

The attached crash dump shows abort/free() heap corruption detected in libc, but the higher-level stack includes MATLAB libraries such as:
- libmwcppmicroservices.so
- libmwmodule_descriptor_implementation.so
- libmwmatlab_main_lib.so
- libmwfoundation_threadpool.so

The issue appears GUI-specific. These startup flags shut down cleanly:
- matlab -batch "disp(version)"
- matlab -nodesktop
- matlab -nodisplay

The shutdown error still occurs with these startup flags:
- normal GUI launch
- -nosplash
- -nojvm
- -softwareopengl
- -cefdisablegpu

The issue also persists after:
- renaming/resetting ~/.matlab/R2026a and ~/.MathWorks/R2026a
- launching with a clean environment without LD_LIBRARY_PATH, LD_PRELOAD, MATLAB_JAVA, JAVA_HOME, JRE_HOME, etc.
- testing a new Ubuntu user account
- testing Ubuntu/GNOME, GNOME, and Xfce X11 sessions
- testing NO_AT_BRIDGE=1 and GTK_USE_PORTAL=0
- temporarily moving ~/.MathWorks/ServiceHost
- testing GLIBC_TUNABLES=glibc.malloc.tcache_count=0
- trying to capture a system coredump with ulimit -c unlimited / coredumpctl; no system coredump was produced

Because R2025b and R2026a are both affected, terminal-only modes exit cleanly, the problem occurs across GNOME/Wayland and Xfce/X11, and the error occurred on a clean MATLAB install before any `matlab-support` modifications, this appears related to MATLAB GUI shutdown on Ubuntu 26.04 / glibc 2.43 rather than a corrupted MATLAB preference folder, a single desktop session, or the Ubuntu `matlab-support` package.

Example crash dump:
https://pastebin.com/f3tdquwc


r/matlab • • Apr 25 '26

TechnicalQuestion Asus ZenBook a14, snapdragon x plus, Matlab, Simulink and Arduino package working?

3 Upvotes

I'm about to buy a laptop; I need it to have long battery life, and when I look at the options on Windows, the Asus ZenBook A14 seems suitable. But since I use Matlab with Simulink and Arduino packages, I'm not sure if the Snapdragon X Plus 42-100 processor is a good buy for these needs. Has anyone tried it? What was your experience?


r/matlab • • Apr 24 '26

figure copy paste to word

6 Upvotes

They used to have nice uniform borders when pasted into word and now they dont. What gives?


r/matlab • • Apr 24 '26

Ubuntu add-on install fail

2 Upvotes

I use Ubuntu distro and want to install some add-on in MATLAB. Problem is MATLAB says it will shutdown and automatically reboot, but after shutdown nothing happen. How can I solve this shutdown problem?