r/matlab • • Feb 16 '16

Tips Submitting Homework questions? Read this

196 Upvotes

A lot of people ask for help with homework here. This is is fine and good. There are plenty of people here who are willing to help. That being said, a lot of people are asking questions poorly. First, I would like to direct you to the sidebar:

We are here to help, but won't do your homework

We mean it. We will push you in the right direction, help you find an error, etc- but we won't do it for you. Starting today, if you simply ask the homework question without offering any other context, your question will be removed.

You might be saying "I don't even know where to start!" and that's OK. You can still offer something. Maybe you have no clue how to start the program, but you can at least tell us the math you're trying to use. And you must ask a question other than "how to do it." Ask yourself "if I knew how to do 'what?' then I could do this." Then ask that 'what.'

As a follow up, if you post code (and this is very recommended), please do something to make it readable. Either do the code markup in Reddit (leading 4 spaces) or put it in pastebin and link us to there. If your code is completely unformatted, your post will be removed, with a message from a mod on why. Once you fix it, your post will be re-instated.

One final thing: if you are asking a homework question, it must be tagged as 'Homework Help' Granted, sometimes people mis-click or are confused. Mods will re-tag posts which are homework with the tag. However, if you are caught purposefully attempting to trick people with your tags (AKA- saying 'Code Share' or 'Technical Help') your post will be removed and after a warning, you will be banned.

As for the people offering help- if you see someone breaking these rules, the mods as two things from you.

  1. Don't answer their question

  2. Report it

Thank you


r/matlab • • May 07 '23

ModPost If you paste ChatGPT output into posts or comments, please say it's from ChatGPT.

109 Upvotes

Historically we find that posts requesting help tend to receive greater community support when the author has demonstrated some level of personal effort invested in solving the problem. This can be gleaned in a number of ways, including a review of the code you've included in the post. With the advent of ChatGPT this is more difficult because users can simply paste ChatGPT output that has failed them for whatever reason, into subreddit posts, looking for help debugging. If you do this please say so. If you really want to piss off community members, let them find out on their own they've been debugging ChatGPT output without knowing it. And then get banned.

edit: to clarify, it's ok to integrate ChatGPT stuff into posts and comments, just be transparent about it.


r/matlab • • 1d ago

I recently joined MathWorks' Engineering Development Group (EDG) and am working on a project to improve Markdown support in MATLAB. AMA!

Post image
570 Upvotes

Hi everyone,

I'm Daniel, a MathWorker who joined the Engineering Development Group (EDG) this past June after graduating in May with a degree in Computer Science and Game Development.

Although it's only been a few months, I'm already working on exciting projects, including some work in the Markdown space for MATLAB. I'd love to hear your thoughts on Markdown and where/how you use it!

Since both my own application process and my first few months at the company are still fresh on my mind, I thought it might be helpful to do an AMA and answer questions about EDG, training and projects, or working at MathWorks in general.

I'm happy to answer whatever questions you all have, from the interview process, to the day-to-day, to my favorite color!

 

See the attached photo for verification, and as a disclaimer: while I do work for MathWorks, I am not an official spokesperson of the company, and everything I say here is my personal opinion.


r/matlab • • 15h ago

Bug Command window not displaying results

Thumbnail
gallery
2 Upvotes

even after reinstalling matlab, trying out both 2026b and 2025b, this bug is persisting. It doesnt even show up when using ver command (pic 2). Can someone help?


r/matlab • • 1d ago

Tips Learning Matlab

14 Upvotes

I’m trying to learn Matlab. I come from exclusively Python programming. Any books/videos/youtubers you recommend for a beginner?


r/matlab • • 12h ago

PID controller with two degrees of freedom

Thumbnail gallery
0 Upvotes

Those results can be easily obtain with simulink


r/matlab • • 1d ago

Mathworks Minidrone competitions

Thumbnail in.mathworks.com
6 Upvotes

Does anyone knows MATLAB in depth . I need a teammate for this competition. If you wanna teamup DM me .


r/matlab • • 1d ago

HomeworkQuestion I've been building a free MATLAB-compatible online compiler using GNU Octave, and I'd love some feedback.

0 Upvotes

Hey everyone!

I'm a computer engineering student, and MATLAB is something we use quite a lot at university, especially for signal processing, mathematical modeling, and other engineering subjects.

A while ago, I started working on a website with different online tools, and one of the things I wanted to add was a way to quickly run MATLAB-style code without having to install anything.

So I ended up building a browser-based compiler powered by GNU Octave, which is free and open source and supports a lot of MATLAB's syntax and functionality.

Here's the compiler if anyone wants to try it:

https://theonlinetoolset.com/tools/octave-compiler

The idea is to make it easy to experiment with things like:

  • Matrices and linear algebra – matrix operations, solving equations, and numerical calculations.
  • Mathematical functions – testing formulas and numerical methods.
  • Signal processing – experimenting with signals, FFTs, and related calculations where supported.
  • Plotting and visualization – working with graphs and mathematical results.
  • .m file support – working with MATLAB/Octave scripts and functions.
  • Engineering coursework – quickly testing small scripts and calculations.

One thing I seriously underestimated was how complicated it would be to run code submitted by users while keeping everything isolated and managing the server's resources.

It's definitely been an interesting challenge, and I'm still working on improving the experience.

Of course, since it's running GNU Octave rather than MATLAB itself, compatibility isn't perfect. Some MATLAB-specific functions and proprietary toolboxes won't work, and I'm not trying to pretend otherwise.

The goal isn't to replace MATLAB or a full desktop installation. I mainly wanted something convenient for students, teachers, or anyone who just needs to quickly experiment with a piece of code.

I'm actually curious about something:

For those of you who regularly work with MATLAB or Octave, what are the biggest compatibility issues you've encountered between the two?

Are there particular functions, toolboxes, or features you rely on that tend to be missing from Octave?

And if you give my compiler a try, I'd genuinely appreciate hearing about anything that doesn't work properly or could be improved.

I'm still developing the project alongside university, so feedback from people who use MATLAB professionally or academically would be incredibly helpful.


r/matlab • • 1d ago

Vehicle Body 3DOF and Longitudinal Wheel stuck at 0 speed (Algebraic Loop/Singularity)

1 Upvotes

I am building an EV digital twin in Simulink using the standard Longitudinal Wheel and Vehicle Body 3DOF Longitudinal blocks. I am not using the Simscape Driveline physical hub/axle blocks. The math signals are routed directly (Fx to FwF, and xdot back to Vx).

The Problem:

The vehicle speed (xdot) is stuck at exactly 0. The solver completes the run, but the vehicle refuses to move.

What I have proven so far:

  1. The powertrain works: The wheel block successfully outputs 6136 N of forward thrust (Fx).
  2. The chassis works: I bypassed the tire model completely and fed a Step block (8000 N) directly into the Vehicle Body's FwF port. The chassis accelerated perfectly on the scope.
  3. The zero-speed freeze strictly happens when I close the feedback loop (feeding vehicle speed xdot back into the tire's Vx input).

Attempted Fixes:

I suspect the Magic Formula tire model is hitting a divide-by-zero singularity at $t=0$, causing an algebraic loop. To fix this, I have already tried:

  • Setting the solver to ode15s.
  • Setting the Vehicle Body Initial velocity to 0.1 m/s.
  • Inserting a 1 / (0.01s + 1) Transfer Function on the Vx feedback line.
  • Adding a Saturation block (Lower limit 0.1) on the Vx feedback line.

Despite this, the vehicle remains locked at 0 speed. Does anyone know the specific trick to initialize this math loop so the vehicle can pull away from 0?


r/matlab • • 4d ago

CodeShare Discord Rich Presence for MATLAB and Simulink: shows what you're editing, running, debugging or simulating

26 Upvotes

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?


r/matlab • • 4d ago

From SysId to Control | Experiment Design and Gotchas

Thumbnail
youtube.com
7 Upvotes

r/matlab • • 5d ago

ماتلاب

0 Upvotes

كيف احصل على تطبيق ماتلاب ف لابتوب الخاص بي


r/matlab • • 6d ago

Fun/Funny Yo guess who is using MATLAB for uni capstone

8 Upvotes

r/matlab • • 7d ago

Fun/Funny MATLAB and Simulink made it into a K-Drama dialogue

Post image
459 Upvotes

My Korean colleague was watching the new K-Drama Between Steps (Episode 3) and did a double-take when the dialogue suddenly turned to MATLAB and Simulink. Thought you might also appreciate it.

You can watch it on Disney+ or Hulu in the US.


r/matlab • • 6d ago

Help 😓

0 Upvotes

Hello everyone, I hope you're all doing well... Well 😊... I'm using COMSOL 6.2, working on a simulation of a proton-exchange membrane water electrolysis system. The problem is, I'm not very experienced with COMSOL and I need to build the model myself from scratch. I haven't found a model in comsol's library 😭 there is a model for a fuel cell, but that's not what I need. Every time I ask for help on Facebook, I get comments about paid services, and I don't even know if they're legitimate... Any advice?


r/matlab • • 8d ago

Looking for Simulink Help

4 Upvotes

I’m looking for someone who has experience with MATLAB Simulink regarding propulsion system?

I already have an existing Simulink model, but I’m still learning how to understand, analyse, and work with it.

I’m hoping to find someone who can guide me through the model, and teach me how to make modifications of the parameters.

I’m happy to offer some compensation for your time and guidance.

Online tutoring is perfectly fine!

If you have experience in this area or know someone who does, please feel free to DM me.

Thank you so much!


r/matlab • • 8d ago

Matlab Student Account

0 Upvotes

Hey guys! I'm a recent BTech graduate and I wanted to learn MATLAB as a skill but my college didn't provide me with free access. I was hoping I could share the access with one of you if you have a college provided free access account. I could still use the 1 month trial version but this is just better and cleaner. Let me know if anyone is up to it!

Thanks in advance


r/matlab • • 9d ago

TechnicalQuestion How do you keep a database that can be accessed/edited by several functions?

7 Upvotes

I'm using matlab to study an exam for orbital mechanics (setting up Codes that calculate ground tracks predict new orbit after a maneuver, all that jazz)

I've thought of sitting down after the exam and turn them into one Big app that students can use to practice and the department may use for their lessons (i wanted to be able to set up exercises like a target orbit to reach or an object to rendevouz)

However, i'm not familiar with the appdesigner yet, and this i'm a bit confused.

For example, how is data stored inside functions? I wanted to make a script that would let you preview the maneuver effect, them hit "confirm" or "redo" and update current maneuver to the estimated maneuver, for example, and sum the extra deltaV and time of flight into a stored data. How do i keep databases that span múltiple functions? Thanks in advance


r/matlab • • 11d ago

Tips [RESOURCE] Why does the Ensemble Kalman Filter work? A justification through non-linear filtering theory

Thumbnail
1 Upvotes

r/matlab • • 12d ago

Boxes not appearing

1 Upvotes

Hello, I was wondering if anyone has the same problem or experienced something similar. Recently, the chack boxes and value fields stop showing. They build underneath, the mechanics still work, if I press where the check box use to the action runs, but the box itself doesn't build in the UI.

I am not sure if it is connected to or not but recently I updated to MACOS 27 and that produced seemingly unrelated bugs with other apps.


r/matlab • • 13d ago

Tips Need some help on my graded project

5 Upvotes

Hi everyone,

I am an undergraduate student and recently we had a graded project course where we have to work on something that we are interested in. Me and my friend have the basics of matlab knowledge but idk what happened to us we chose to do behavioural modelling of ADPLL for BLE application using MATLAB and simulink.

I can describe my project like this

A MATLAB/Simulink-based behavioral analysis of a BLE ADPLL, with emphasis on transient response, frequency tracking, closed-loop behavior, and the effect of TDC quantization and DCO variations on locking performance.

But now we are stuck. I am really confused about what I am supposed to do and what i am doing. I am not able to understand most of the things and our guide is useless, she is not helping a bit. I know we rushed and stuff but we don't have any options left and we can't back out now.

I just want someone to guide me through the process and genuine opinions on the project and to answer my doubts. Please help me out if you can!

The deadline for this project is 26th so I am kind of in hell.

If anyone has any tips please drop them in the comments!


r/matlab • • 13d ago

Trying to learn trajectory control

Thumbnail
0 Upvotes

r/matlab • • 14d ago

Best way to model a compliant hinge in MATLAB?

Post image
14 Upvotes

I’m modeling a 3D compliant hinge mechanism in MATLAB with large rotations. I first used a rotational spring at a single node, but most of the deformation happened in the surrounding beam elements instead of the hinge.

What is the best way to model this type of compliant hinge in MATLAB? Any reference, example, or code would be very helpful.


r/matlab • • 15d ago

Guide: How to install and run the Windows version of MATLAB on Linux

17 Upvotes

Hey everyone,

i put together a quick step-by-step GitHub repo on how to properly install and run the Windows version of MATLAB on Linux using Wine.

You can find the short guide here:

https://github.com/pasqualecofone/matlab-windows-version-on-linux-system/blob/main/README.md

Let me know if it works for you!


r/matlab • • 14d ago

A PID controller implemented in python

Thumbnail gallery
0 Upvotes