r/matlab • u/surigami • 6h ago
CodeShare Discord Rich Presence for MATLAB and Simulink: shows what you're editing, running, debugging or simulating
Discord shows when you're gaming or listening to Spotify, but six hours of debugging a Simulink model shows up as nothing. I'm an electrical engineering student and live in MATLAB most of the week, so I wrote drpc, Discord Rich Presence for MATLAB.
What it shows
- Editing pid_controller.m, with the line you're on and whether it's saved
- Running a script, timed from when the run started
- Debugging, paused at line 87
- Simulating a Simulink model, with % done
- App Designer, figures, the Command Window, and "Away" after 10 minutes idle
How it works
- It runs entirely inside MATLAB. No Python or Node helper in the background.
- A watchdog on a background thread notices when MATLAB is stuck in a long loop and switches you to "Running", so your status doesn't freeze.
- MATLAB never waits on Discord. If Discord is closed or restarting, MATLAB doesn't notice, and drpc reconnects when it comes back.
- The small C# bridge that talks to Discord is compiled on your PC from source, using the compiler that already ships with Windows. The repo contains no DLLs or EXEs.
Privacy: drpc names off hides file names, hidden_folders hides specific projects, and drpc pause hides everything for the session. It only talks to the Discord app on your own PC.
Install: paste this into the Command Window:
unzip("https://github.com/akeanti/matlab-discord-rpc/archive/refs/heads/main.zip", tempdir); run(fullfile(tempdir, "matlab-discord-rpc-main", "install.m"))
If you'd rather read the code first, download the latest release, look through it, and run install yourself.
Limits: Windows 10/11 only for now. You need the Discord desktop app and R2021a or newer. I've tested it on R2024a. On R2025a and later, telling the Editor apart from the Command Window relies on the old desktop, so that one detail may be off. If you're on 2025a+, I'd really like to know how it behaves.
macOS and Linux would need a different bridge (Discord uses a Unix socket there instead of a named pipe). It's doable, and PRs are welcome.
Repo: https://github.com/akeanti/matlab-discord-rpc
Free and MIT licensed. Not affiliated with MathWorks or Discord.
What part of MATLAB should it show that it doesn't yet?


