r/matlab • • Feb 16 '16

Tips Submitting Homework questions? Read this

195 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.

112 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 • • 23h ago

HomeworkQuestion Can't figure out how to index this array

0 Upvotes

I have an array that uses a for loop to make the array with an input number of values. This represents a value per month. I need to graph this per year, and I do not know how to turn the months into years.

I thought of doing another for loop but I just can't figure out how to do it without knowing the amount of months


r/matlab • • 1d ago

Graphical Help Sought

2 Upvotes

Kia ora! First, this is my favorite software for all things. With this being said, I am garbage at programming. Is there a straight-forward way to construct 3d projection of hypercube in MATLAB?


r/matlab • • 2d ago

Fun/Funny I unironically love how simple MATLAB's syntax is for working with matrices

Post image
301 Upvotes

r/matlab • • 1d ago

Help

Post image
0 Upvotes

How to access?


r/matlab • • 1d ago

Help

0 Upvotes

I create New a count but the , say:You have reached the maximum number of emails that you may send. Try again later or contact Customer Support., how to make access


r/matlab • • 2d ago

How to create Hardware in loop for everyone in matlab simulink from scratch

1 Upvotes

I don't know how to do it 😭 but I have interest on ev side can anyone help me


r/matlab • • 3d ago

Fun/Funny Thanks, the first live AI coding session for One-Button Game Contest wrapped

Post image
4 Upvotes

r/matlab • • 2d ago

MATLAB HELPP ANYONE PLSSS

Thumbnail reddit.com
0 Upvotes

r/matlab • • 3d ago

HELP - Simulink onramp messes up my keyboard

0 Upvotes

I’ve got the latter 50% of the Simulink on-ramp to complete by noon tomorrow. The content? Simple. The problem is that when I get to a certain task, one where you have to change the value of a constant to 10*0.25, it cries, and my keyboard stops working for Simulink as a whole. Just ceases to work. If it does work, a key spams indefinitely. Only solution I have is to force restart. Even then, it’s a 50/50 whether it’ll work again. Any solutions?


r/matlab • • 4d ago

Running MATLAB natively on Raspberry Pi and DGX Spark: MATLAB on Linux ARM is now in open beta

28 Upvotes

Hi everyone

Here's a screenshot of MATLAB and Simulink running natively on my Raspberry Pi 5 courtesy of the new MATLAB for Linux ARM beta that we released this week

In my latest article, I discuss this new beta; how you can install it directly or in Docker / Apptainer containers and show some performance issues on DGX Spark and Raspberry Pi that I've reported to development.

Running MATLAB natively on Raspberry Pi and DGX Spark: MATLAB on Linux ARM is now in open beta | The MATLAB Blog

I know that many of you have been waiting for this for a long time so please head over, take a look and let us know how things look for your workflow.

Cheers,

Mike


r/matlab • • 4d ago

TechnicalQuestion Can I embed a working Simulink model in my slides. Is it possible

3 Upvotes

I have my undergrad project presentation tom... Is there any way to embed Simulink in slides so that I can show the working & explain blocks ?

Modelled a hydraulic actuation system, was wandering If I can just embed in slides & avoid reopening a second laptop


r/matlab • • 5d ago

Fun/Funny One-Button Game Contest - one week in

Thumbnail
gallery
19 Upvotes

So far, the Lunar Lander - Tap to Burn is the top entry. KOI is the close second, Pump-Send: A Mountain Bike Adventure in the 3rd place.

Play the games and vote for your favorites! https://www.mathworks.com/matlabcentral/communitycontests/contests/10/entries?week=all


r/matlab • • 5d ago

Tips Need help

0 Upvotes

I’m just beginning to model and simulate stuff in MATLAB simulink so i need to model a low inertia grid for my minor project ( like more inverter based sources less rotating generators) I’m really struggling as I don’t know how to start n proceed I don’t even know if I’m going in the right direction 😭 pls help me even little inputs are welcomed 🥰🥰


r/matlab • • 6d ago

HomeworkQuestion Why is h bounded?

Post image
17 Upvotes

I understand the premise of this problem. We just learned how to use fminbnd, and for this problem in particular the clear path ahead is to define an anonymous function V = @(h) such that V is the volume of the solid and h is our input height. Using the negative volume we can use fminbnd to find the max volume as well as the value of h needed to output it.

I came up with V = @(h) -120*(70*h + 35^2)

(70*h is the area of the rectangular face without the triangle, 35^2 is the area of the triangle

At this point something is fishy. h is clearly unbounded with my (supposedly) incorrect formula for volume. I am staring at this solid and picturing h increasing to infinity and I don't see how this is even an optimization problem. The volume appears to increase indefinitely as h does.

edit: I see now that I was thinking about the problem incorrectly. I thought the top width was fixed at 70 in. I think what it actually means is that if we were to unfold this thing and measure across we would measure 70 in.


r/matlab • • 6d ago

TechnicalQuestion How to limit argument validation function visibility?

3 Upvotes

In Function.m I have

function Function(a)
arguments
a (1,1) double {Validator(a)}

end
printValue(a);
end

function Validator(a)
arguments

a (1,1) double
end
if mod(a,7)
error("Invalid argument.");

end

end

function printValue(a)
disp(a);
end

I want to further restrict the visibility of Validator such that it can be called only by Function. I tried to make Validator a nested function of Function, but MATLAB throws me the error "calling nested functions is not supported in arguments blocks". So how do I restrict Validator to be called only in Function and not in other local functions from Function.m (like printValue)?

Edit: sorry for formatting, but Reddit ignores spaces when I write code.


r/matlab • • 5d ago

Trying to replicate MATLAB 2015 model with Google Sheets...

0 Upvotes

I've tried to replicate the tomato growth model in this article (https://www.researchgate.net/publication/393702875_Dynamical_Modeling_Using_Internet_of_Things_of_Nutrients_N-P-K_for_Vegetables_Optimum_Production) with Google Sheets. As far as I can tell, I've transferred everything in the article to my Google Sheet, but I'm still ending up with values that are magnitudes above the ones described in their graphs. Am I missing something? Is there something MATLAB does automatically that I've neglected to replicate in my Google Sheet? (Here's a link to my Google Sheet if anyone has the time/energy to read over that; although I've used several named functions, so it's a bit of a mess... https://docs.google.com/spreadsheets/d/1vCKXB04qaMSihZ8ISPF2fsiftowwSeUYLIEyYP-6-KA/edit?usp=sharing)


r/matlab • • 6d ago

An open source 6DOF TVC simulator, tested on 4 successful flights

2 Upvotes

r/matlab • • 7d ago

TechnicalQuestion DVB-RCS2 TCLM Example in Matlab R2026a

3 Upvotes

Hi Everyone,

I'm working with the official MathWorks DVB-RCS2 link simulation example in MATLAB R2026b, specifically the TC-LM (Turbo Coding with Linear Modulation) transmission format.

Official example: https://www.mathworks.com/help/satcom/ug/end-to-end-dvb-rcs2-simulation-with-rf-impairments-and-corrections-for-tc-lm-bursts.html

While testing different waveform IDs, I've observed the following issues:

  1. Some waveforms are not passing at all

Certain waveform IDs consistently fail to achieve successful decoding, even when using the default simulation configuration.

2. Index-out-of-bounds errors at low E/N

For some waveform IDs, the simulation throws an index-out-of-bounds error at lower E/N values and terminates instead of completing the PER evaluation.

3. Significant gap between specification and simulated thresholds

There is a noticeable gap between the E/N thresholds specified in the DVB-RCS2 specification and the thresholds achieved by the MATLAB example.

I'd like to understand whether this is an expected result of the example or whether there could be an issue with the waveform-specific receiver processing, synchronization, or implementation.

4. Satellite channel modelling

The example includes AWGN and selected RF impairments, but I haven't found a complete satellite propagation channel model integrated into the simulation.

I'd like to understand the recommended approach for incorporating realistic satellite channel effects, such as Doppler, propagation delay, and other relevant impairments.

Questions:

  1. Has anyone tested the different supported TC-LM waveform IDs using this official example? Are there any known issues with particular waveform IDs?

  2. Are the index-out-of-bounds errors at low E/N known issues, particularly when burst detection or synchronization fails?

  3. Has anyone validated the PER-versus-E/N performance of this example against the DVB-RCS2 specification? Is a significant threshold gap expected?

  4. Are there any recommended corrections or configurations to achieve performance closer to the specified thresholds?

  5. Is there a recommended satellite channel model or approach for extending this example beyond AWGN and the included RF impairments?

I'd appreciate feedback from anyone who has worked on DVB-RCS2 TC-LM, satellite link-level simulations, or the MathWorks Satellite Communications Toolbox.

Thanks in advance!


r/matlab • • 8d ago

Advent of Code In Simulink

7 Upvotes

Dear all,

I've seen people attempt to do Advent of Code using ladder logic for PLCs or graphical programming environments, but I've never seen anybody do the competition using Simulink.

In preparation for Advent of Code 2026 I decided to do Advent of Code 2025 in Simulink, using only Simulink blocks, no Stateflow or MATLAB function blocks. I managed to solve all challenges using block diagrams, with the exception of Day 10 Part 2, where I used `intlinprog`. I think most people used a library for that day.

The solutions are not universal and some of them are tailored to my inputs, but if anybody is interested, they can be found here: https://github.com/ptoshkov/aoc-2025-simulink

For the 2026 edition I will attempt to make cleaner universal solutions and I will try not to use any MATLAB functions. Hope someone finds this interesting or inspiring.


r/matlab • • 7d ago

Question-Solved Hello everyone I need some help

1 Upvotes

Recently I have been trying to switch from my core electrical job to matlab is this ok for me

Give me some guidance.

Is this career switch good or not.

What is the future in Matlab

Is AI taking the job of Matlab Engineers

Please guide and help me


r/matlab • • 9d ago

Misc Engineers: how much do you trust AI-generated results?

27 Upvotes

AI is in the news practically every day, and it’s starting to pop up in engineering fields as well.

There are obviously a wide range of opinions about what that means for engineering.

MathWorks is running a short survey to understand how engineers think about AI, including:

  • How much should engineers trust AI-generated results?

  • What level of validation is necessary?

  • How should organizations govern AI-assisted engineering work?

It’s 15 questions and takes about 3 minutes: Take the anonymous survey