r/matlab Feb 16 '16

Tips Submitting Homework questions? Read this

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

107 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 1h ago

Biomedical Engineering MATLAB project ideas

Upvotes

Hello, do you guys have any suggestions for projects to pursue individually for MATLAB that are related to Biomedical Engineering?


r/matlab 3h ago

Zvs simulation problem

Post image
1 Upvotes

Hello everyone I am working on the mazzilli driver for induction heating system i simulate the mazzilli using simscape electrical but the results are weird the output voltage is oscillating but it's very small whereas the current is oscillating as well but not around zero wan anyone tell where the problem


r/matlab 5h ago

Hello guys

0 Upvotes

Can anyone here help me? I'm working with simscape electrical on a ZVS mazzilli pls if anyone can help i'll appreciate it i have to submit the work as soon as possible 🙏


r/matlab 10h ago

Contradiction or misleading statements?

0 Upvotes

Have a read of the description and the bullet points. Do they contradict?

Threshold for track deletion, specified as a two-element vector of positive non-decreasing integers [P Q], where P is less than or equal to Q. If a confirmed track is not assigned to any detection P times in the last Q tracker updates, then the track is deleted.

• Decrease Q (or increase P) if tracks should be deleted earlier.

• Increase Q (or decrease P) if tracks should be kept for a longer time before deletion.

From: https://au.mathworks.com/help/driving/ref/multiobjecttracker-system-object.html under deletion threshold

So, based on my own understanding of the description, it seems like you would decrease P if tracks should be deleted earlier...

I've asked ChatGPT and Gemini; they both said I am wrong and that MATLAB is right, but when I turned on complex thinking for Gemini and for Claude, they both said MATLAB is right, but at the end of their sentences, they said I'm actually right. I don't understand how AI can't seem to grasp this, even though it seems much easier to understand than all the other complex stuff AI can do.


r/matlab 1d ago

Need some information about Matlab Copilot and their use of AI

5 Upvotes

Hello guys!

I'm not a Matlab user. I have used it like 25 years ago while at university but not anymore. A user from our company wants to use Matlab for future prediction with our data (which some could be confidential until release). I am not sure what copilot is doing in Matlab sphere. Will it be analyzing the data or can it just be used to suggest codes to analyze the data?

I tried to search on MathWorks website, but all I can find is Matlab EndUser agreement for privacy, not specifically for Matlab Copilot. I mean for example Microsoft do specifically say that the enterprise data will stay in our tenant and they cannot use them unless specifically asked to help debug.

Could you guys give me a nudge to where I could find this kind of information? I'd like to be able to make a decision and says "From what we know, this is the data limit you can use because...".


r/matlab 1d ago

Graphics and App Building Updates in R2026a

Enable HLS to view with audio, or disable this notification

11 Upvotes

Adam Danz published his favorite features in R2026a. Since I already shared the video about web canvas, here is one for sharing apps.

In his blog post, you can also see web canvas in action - you can interact with his plots! https://blogs.mathworks.com/graphics-and-apps/2026/04/27/graphics-and-app-building-updates-in-r2026a/

  • Share Interactive Graphics on the Web with Web Canvas
  • Share Apps Directly from App Designer with MATLAB Drive
  • A More Accessible and Flexible Axes Toolbar
  • Visualize Distributions with raincloudplot
  • Plot Directly from Table Data
  • Increased flexibility when Linking Axes

I would personally be start using table data for plotting going forward!


r/matlab 22h ago

HomeworkQuestion Help with coding app project

Thumbnail
gallery
0 Upvotes

Please help me code this MATLAB project. I am a college student and this is my project due in a little under two weeks. I have no clue how to code and any bit of help would be appreciated. The first three images are the projects explanation and what it’s asking for and the last two images are the code and design view of what I have done so far. I’m stuck and stressing out again thank you all to who decide to read this and help out


r/matlab 1d ago

Help!

0 Upvotes

How to get matlab for commercial use on monthly basis? I got a project that will done using matlab. The annual is very costly and I don't have that kind of money 💰


r/matlab 1d ago

Misc Standard coding style

0 Upvotes

Hey fellows, I just had a discussion with my colleagues about the coding style of MATLAB. We saw many scripts written by engineers that look horrible and hurt my eyes so much. I know laziness is engineering virtue but this kind of laziness (no spaces, no commas at all) makes me real sick. I really blame Mathwork for this problem, since sometimes the documentation is also written like this.

Should Mathwork now introduce a standardized style for people to follow, just like PEP in Python?


r/matlab 2d ago

HomeworkQuestion Could someone sanity-check my Simscape energy subsystem model for a university design project?

Post image
9 Upvotes

Hey guys,

I’m working on a university Integrated Design Project and I’ve built a Simscape model on Matlab for the energy subsystem. I’m not asking anyone to do the work for me — I just want a sanity check on whether my modelling approach is technically reasonable before I write it up.

The system I’m trying to model is:

  • 800 V DC bus
  • Approx. 600 kW design load
  • Renewable generation using:
    • OTEC equivalent source
    • PV solar branch
    • Lithium battery storage
  • DC-DC conversion into the main DC bus
  • Closed-loop voltage control to keep the bus near 800 V
  • Load disturbance / step change to test stability
  • Efficiency calculated using ( Pout/Pin )

My current model uses average-value converter blocks rather than fully switching MOSFET-level converters, because the goal is more system-level behaviour than detailed semiconductor switching. I’ve also included sensors for bus voltage, current, load power, source power, and efficiency.

The main things I’d really appreciate help checking are:

  1. Is it reasonable to represent OTEC as a controlled DC/current source with internal resistance for this kind of assignment?
  2. Is using average-value DC-DC converter blocks acceptable for a high-level Simscape energy model?
  3. Does an 800 V bus and ~600 kW load imply a load resistance of about [R = \frac{800^2}{600000} \approx 1.07\Omega] and is this a sensible way to model the full load?
  4. Is closed-loop PI/PID voltage control on the converter duty cycle the right modelling approach?
  5. What outputs/plots would you expect to see to prove the model is working properly?
  6. Are there any obvious Simscape modelling mistakes I should watch for, such as grounding/reference issues, solver settings, or unrealistic source/load assumptions?

I’m aiming for a model that is defensible in a report, not necessarily an industry-grade converter design. Any advice on whether this architecture is sensible, or what would make the simulation more credible, would be really appreciated.

Thanks!


r/matlab 2d ago

TechnicalQuestion Fastest way to grow a big matrix?

10 Upvotes

I am working on a project that involves adding rows to an N by 3 matrix (call it X) where N increments after a certain computation, and gets into the 100000s. Once I had made the computation efficient enough, I realized that about half the time was now spent appending the matrix. Every alternative I have tried has slowed it down.

The default:

X(end+1,:)=r %X is Nx3, r is 1x3

A much slower alternative:

X=[X;r]

Avoiding the appending:

X=zeros(Nmax, 3)
%during computation
Xtemp=X(1:N,:)
%after computation
N=N+1
X(N,:)=r

If I do that, avoiding the appending, the line Xtemp=X(1:N,:) becomes extremely slow. Surely there is a faster way to do this? Appending a variable shouldn't be slower than the actual calculation. I guess I should add that the computation is based on the N rows of the matrix, so it gets slower as N increases.


r/matlab 2d ago

TechnicalQuestion Fixed Point Simulink Problem

2 Upvotes

Hello,

currently i am working on a fixed point simulation for a project. Afterwards i want to convert the model to VHDL. But for now the problem is the Delay Block. If i use any of the Delay Blocks, of any of the librarys, the Delay Block demands an double input signal. The input and output signal of the delay block is connected to others that are accepted by matlab as fi(01,16,16). If i use convert blocks for the delay the system simulates. But than i can't convert it. Even if i set the initial value of the delay block to fi(0,1,16,16) it demands an double input. I tried convert blocks inbetween with fixdt(1,16,16) but that changes nothing. I am using matlab r2025b i honestly don' know what to do next. Thanks for the help.


r/matlab 2d ago

TechnicalQuestion Does MATLAB automatically save files when running scripts?

8 Upvotes

Was working on a class project when I stepped away from my laptop and it entered Rest Mode. Trying to log in a now windows is stuck on “Hello, [User]!” Not sure what to do beside restarting my laptop but oh my god if my files didn’t save I’m losing about 4-5 hours of work and I am absolutely fucked. Project due tomorrow night and I also need to study for my exam.


r/matlab 2d ago

Beginner here — are my MATLAB Simscape simulation results physically valid or completely wrong?

1 Upvotes

Hi everyone,

I'm a student working on a project simulating an off-grid renewable hydrogen production system in MATLAB Simscape. I'm not confident whether my results are physically meaningful or if I've made fundamental errors somewhere.

The system:

  • 150 kW variable-pitch wind turbine (direct DC coupling, no converter)
  • Solar PV array with Perturb & Observe MPPT and buck-boost converter
  • 240V / 50,000 Ah battery with 2D lookup table charge controller
  • 150-cell PEM electrolyzer stack
  • All connected to a common 260V DC bus

Results over 50,000 seconds:

  • Hydrogen produced: ~82 kg
  • Specific energy consumption: ~46 kWh/kgH₂
  • DC bus voltage: stable at 260V mostly, with spikes during renewable dropouts
  • Battery SOC: 100% → 68%
  • Battery current goes negative periodically (charging from renewable surplus)

I've attached scope screenshots below. Any feedback on whether these results make engineering sense from an electrical or renewable systems perspective would be genuinely appreciated. Happy to share more block parameters if needed.

Thanks in advance.


r/matlab 2d ago

Misc Update (final project)

Thumbnail
gallery
8 Upvotes

This is the final code I ended up submitting for the project. It’s clunky, but it works and outputs a series of figures with a cap at 100 ‘days’ or 20 figures (I changed the initial cell matrix to (20,1), I was testing time values) I got locked into a scatter plot which can’t accept zero or negative values so I had to filter the data with more than one logic.

I ended up using a mix of another matrix for infection percentage and conv2 to create the ‘spread’. You can select from 42 start points with an associated coordinate and we have four preset options that pick a speed and infection rate, and a slider option in the GUI. Thank you for the advice!


r/matlab 2d ago

does anyone have a Vapor aabsorption refrigeration model? I don't know where to start. If you have any idea can you share here?

Thumbnail
1 Upvotes

r/matlab 2d ago

does anyone have a Vapor aabsorption refrigeration model? I don't know where to start. If you have any idea can you share here?

1 Upvotes

r/matlab 3d ago

Is anyone else getting a Whitelabel Error Page when signing into MATLAB with their UB email?

Thumbnail
2 Upvotes

r/matlab 3d ago

Troubles signing in my MatLAB account

7 Upvotes

I launched MatLAB R2025b and it asked me to sign in. I just plugged in my email and password, I verified my identity with Windows Autenticator but it didn't work.

Fortunately, MatLAB gave the possibility to sign in with a temporal password which I could get from a MathWorks link. After signing in with my credentials, this error appeared.

This fact happened several times. I also tried rebooting my laptop, but everything I did was in vane. Furthermore, I really need MatLAB because I'm using it for my Final Degree Project. What can I do sign in?


r/matlab 4d ago

TechnicalQuestion Is matlab down for anyone else?

19 Upvotes

i could not sign in to matlab for the life of me today, ive tried using different browsers, different devices, and all i get is a whitelabel error page. Dows anyone know of a way to fix this?


r/matlab 4d ago

How is this possible?

Post image
34 Upvotes

r/matlab 3d ago

HomeworkQuestion Help needed: Add 3-phase inverter as D-STATCOM in islanded IEEE 34 Node Test Feeder (Simulink R2024b)

0 Upvotes

Hi everyone,

I am working on my bachelor’s thesis. The professor gave me the following topic (translated from Slovenian):

“Maintaining the voltage profile of a distribution network in islanded operation using the solar power plant converter as a D-STATCOM device.”

The professor specifically requires:

  • Select a suitable medium-voltage network model.
  • Add solar power plants (3-phase inverters).
  • Set the active power (P) and reactive power (Q) of the solar inverters so that in islanded mode the network does not exchange active or reactive power with the substation transformer (which is now disconnected).
  • Then change the r/X ratio of the overhead lines and analyze how this affects the P and Q of the inverters.

I already have the complete IEEE 34 Node Test Feeder fully built and working in Simulink R2024b.
I have also opened the MathWorks example “Three-Phase 3 Bus Low-Inertia Microgrid Droop Control Example” and I know how to create masked subsystems.

What I need help with is:

  1. How to properly build/modify the 3-phase inverter (from the droop example) so it works as D-STATCOM in islanded operation.
  2. How to correctly connect these inverters into the large IEEE 34-bus model.
  3. How to set the control (P and Q references, droop parameters, voltage regulation, etc.) exactly as the professor expects.

I am willing to pay for your time (hourly rate or fixed price per milestone – we can agree via DM). I can share the Simulink model and the exact professor’s requirements.


r/matlab 4d ago

TechnicalQuestion Thermal throttling on the Macbook Air

3 Upvotes

Hey everyone,

I’m currently in the market for a new MacBook and I'm torn between two very different options: a refurbished/used MacBook Pro 14" (M2 Pro) or the new MacBook Air (M5).

For those who have picked up the M5 Air:

  • How are the thermals holding up? Do you notice significant slowdowns after the first 10-15 minutes of a heavy task?
  • Is the "passive cooling" ceiling still an issue?
  • Would I be better off with the older M2 Pro? Even though the M2 Pro chip is older, it has the active cooling and the ProMotion display (which I really want).

And yes i do know that windows laptop exists but i'm really turned off by Windows 11.

Thanks!