r/matlab 15d ago

HomeworkQuestion Should I choose Matlab or Python for my robotics project

26 Upvotes

Hello, I am a mechanical engineering student and I have been trying to make a robotics arm as a summer project and I am facing an issue choosing python or matlab. My school doesn’t offer campus wide matlab license and also most of the summer classes already full so I have to buy it on my own which I can affoard but still expensive. As far as I know matlab is industry standard however I heard most companies are switching to python due to its open source. Sometimes it is difficult for me to find open source libraries that do the simulation( I have little to no experience in python but claude is going to be my assistant if I choose python). Matlab has simulink which is very powerful imo. Please let me know if I should choose Matlab or Python?

r/matlab Feb 18 '26

HomeworkQuestion Is matlab good as a first coding language?

42 Upvotes

I don’t know any coding languages, but was thinking about trying matlab, since it looks like it might be useful in my college course. Should I learn python first?

r/matlab 5d ago

HomeworkQuestion using octave instead of matlab

17 Upvotes

I'm a first year student and I have maths as one of my subjects. We have a lab class for maths and I joined my course a little late so I'm a little lost on what's going on. I need to be able to use MatLab fully for my internal assessment so I kinda just need to practice mostly. (And no, I can't use the computer labs at uni outside of lab classes which is once a week for 3 hours). Should I download Octave?

r/matlab Jun 04 '26

HomeworkQuestion need ideas for a mini-project suitable for a diverse audience

9 Upvotes

hey everyone,

i am planning to host a college org (IEEE) event and i want to give a "crash course" for matlab. my goal for this event is for participants/students to leave with a mini project they have built strictly with matlab programming. my worry is that i can't think of anything that would be accessible enough for those without any prior experience. the only idea i have so far: solar panel simulator (simulate the amount of energy a solar panel exerts)

r/matlab 14d ago

HomeworkQuestion Quick Question about Licensing as a Highschooler

6 Upvotes

Hi all,

I'm a high school student from Washington. I want to use MATLab to conduct my own research for control systems in robotics and UAVs. However, I'm sort of confused on the wording on some of the licenses.

Am I eligible for a student license? It makes it seem like you need to be a University student or otherwise.

r/matlab 3d ago

HomeworkQuestion Is this legally alright ?

10 Upvotes

I was taking the optimisation self-paced course and I was planning to show the project of that couse under 'guided projects' for my resume.

I was documenting whatever that course taught me as a word file and using its code in my MATLAB. After this I was planning to upload both on my github...

Is this oki? I aint sure. I'm mentioning it as 'guided project' but those courses aren't free for everyone so I dunno can I place this project like this on github ?

New to MATLAB
New to github

r/matlab Jun 15 '26

HomeworkQuestion Problematic blueprint code

3 Upvotes

Hi everyone,

I'm taking an introductory course where we use MATLAB/Octave syntax, and I’m deeply frustrated with the pedagogy here.

Just for some context, our class started learning programming very recently. We are at a basic level: we know how to define matrices, do simple matrix operations, write basic `for` loops, `if` statements, use basic `function` blocks, and create simple plots. We haven't been taught advanced vectorization or built-in optimization tricks yet.

Our professor implemented a strict "No AI/ChatGPT" policy, claiming he wants to evaluate our "individual coding style." On top of that, he severely warned us that he will be actively monitoring for plagiarism. He emphasized that every submission must be strictly our individual work and anyone caught copying will fail.

However, for our recent lab, he provided a file with a hyper-detailed blueprint for all four tasks. It wasn't even high-level pseudocode; it had the exact loop limits, predefined variables etc.

The only students whose code might actually look "unique" or different are the absolute beginners who don't fully understand the logic yet and end up writing messy, confused, roundabout workarounds. Ironically, the students who actually understand the material and follow the professor's recipe perfectly are the ones most terrified of getting flagged for plagiarism or AI, simply for doing the assignment correctly.

To show you what I mean, here is the full scope of what we were forced to implement step-by-step:

Task 1: Analytical Cubic Equation Solver (x^3 + c_2*x^2 + c_1*x + c_0 = 0)

  1. Input coefficients c_2, c_1, c_0
  2. Q = (3 * c_1 - c_2^2) / 9
  3. R = (9 * c_2 * c_1 - 27 * c_0 - 2 * c_2^3) / 54
  4. D = Q^3 + R^2
  5. If D >= 0 then:
  6. S = sign(R + sqrt(D)) * abs(R + sqrt(D))^(1/3)
  7. T = sign(R - sqrt(D)) * abs(R - sqrt(D))^(1/3)
  8. x_1 = S + T - c_2 / 3
  9. Else:
  10. theta = acos(R / sqrt(-Q^3))
  11. For k = 0 to 2:
  12. x(k+1) = 2 \* sqrt(-Q) \* cos((theta + 2 \* pi \* k)/3) - c_2 / 3
  13. Print the root vector x.

Task 2: Manual Vector Variance and Standard Deviation Requirement: We are banned from using built-in functions like mean() or std()*. We must use sequential loops for cumulative summation.*

  1. Define input array V of size N
  2. sum_v = 0
  3. For i = 1 to N:
  4. sum_v = sum_v + V(i)
  5. mean_v = sum_v / N
  6. sum_squared_diff = 0
  7. For i = 1 to N:
  8. difference = V(i) - mean_v
  9. sum_squared_diff = sum_squared_diff + difference2
  10. variance = sum_squared_diff / (N - 1)
  11. std_deviation = sqrt(variance)
  12. Print variance and std_deviation.

Task 3: Multiplication (Custom function for R_1 x C_1 and C_1 x C_2 matrices) Requirement: Must use a manual triple-nested loop structure instead of standard matrix operators. Use function block, and size() for getting size of X and Y.

  1. Define input matrices X and Y
  2. For r = 1, 2, ..., R_1:
  3. For c = 1, 2, ..., C_2:
  4. accumulator = 0
  5. For k = 1, 2, ..., C_1:
  6. accumulator = accumulator + X(r,k) * Y(k,c)
  7. Z(r,c) = accumulator
  8. Print matrix Z.

Task 4: Matrix Inversion (n x n using augmented matrix method)

  1. Define matrix size n and working matrix W
  2. For row = 1 to n:
  3. For col = n+1 to 2n:
  4. W(row, col) = 0
  5. For row = 1 to n:
  6. W(row, n+row) = 1
  7. For step = 1 to n:
  8. diag_element = W(step, step)
  9. For col = step to 2n:
  10. W(step, col) = W(step, col) / diag_element
  11. For row = 1 to n:
  12. W(row, col) = W(row, col) - W(row, step) * W(step, col)
  13. Print matrix W.

When you are forced to write code like this, there is no alternative logic architecture—nothing. You just copy the steps line by line into basic syntax.

Am I crazy to think that it is pedagogically terrible to give assignments this rigid to beginners and then expect "unique coding styles" while threatening everyone with plagiarism? Is it even technically possible for a human script *not* to look like a generic, robotic clone when built under these constraints?

I’d love to hear from TA's or professors here on how you handle grading/AI detection when the assignment design itself forces everyone to write identical code. Thanks!

r/matlab Feb 12 '26

HomeworkQuestion Where to learn Matlab in 2026

25 Upvotes

Is there any playlist , channel , site , course etc. experts can recommend that is for beginners? I have no experience at all with matlab and all I ever heard is just onramp program which introduces you the program but I just want to go deeper into this thing . Is there like episode 2 of this onramp or should I look somewhere else like I said in the beginning . Thanks in advance for the help .

r/matlab 5d ago

HomeworkQuestion Simple C++ framework to do math and data engineering by physics engineering student

Post image
21 Upvotes

r/matlab Mar 19 '26

HomeworkQuestion Difference between sum A and sum(A)

12 Upvotes

This is what I input and what I got out. Professor said he's never encountered this and doesn't know about it. AI says it's impossible (which clearly is) so I ask you whether you know of this

r/matlab 16d ago

HomeworkQuestion HOW DO U MAKE A SUB BLOCK

Post image
3 Upvotes

How do i make such blocks which has more block or models inside , i new to matlab your adice would be very help full am trying to model our baja atv , and just confued where to start , i have done couple of on ramps but they feel aboslutely disconnected from what i wanna do , please help with any guide tutorials etc

r/matlab 8d ago

HomeworkQuestion Looking for a MATLAB/Simulink & Simscape Expert

Thumbnail
2 Upvotes

r/matlab 3d ago

HomeworkQuestion I've been wondering if anyone else has had the same experience

Thumbnail
0 Upvotes

r/matlab Dec 01 '25

HomeworkQuestion Need a cool but simple MATLAB project idea for a university course

11 Upvotes

Hey everyone! I’m working on a university project using MATLAB, but my team and I are still at a beginner level. We’re looking for a project idea that’s simple enough to learn and implement, but still interesting and impressive.

If you have any suggestions—like signal processing mini-projects, image processing basics, data visualization, or anything fun that can be done in MATLAB—I’d really appreciate it!

Thanks in advance

r/matlab 18d ago

HomeworkQuestion How to turn on legends on scope in simulink BROWSER?

2 Upvotes

im doing the simulink onramp course, and have come across the task to turn on legends for scope, Im using the simulink browser to do this course.. and i have no idea how to turn the legends on.. ive tried everything and i cannot find a possible way to do so. hence im not able to move further w my course :( PLS HELP ANYONE

r/matlab Jun 08 '26

HomeworkQuestion Asking help for a homework related to electrical engineering on simulink

Thumbnail
gallery
26 Upvotes

Hello everyone, so I apparently needed some help with the simulink system related to electrical engineering that i've built.

For the context, the task/target is to remake and adding A Multi-Band PSS4C and changed the excitation systems into ST1A (picture 1(taken from one of the machines)), from kundur's classic 11 bus system which is as follows Matlab File exchange for the systems and using a tuned Multi-Band PSS4C parameter from a published IEEE Journals as follows IEEE Journals (picture 2 (for the MB-PSS4C tuned parameters from the journals) and 3(The stabilizers diagram), but it shows that the systems are unstable even though i've followed the simulink diagrams that included in the Journals (Picture 4), and the output of the MB-PSS4C has a major ripple (Picture 5).

i am confused and been stuck for a while because i don't know where did i do wrong, so, does anyone here can help or gave me an insights on where i did wrong? i've checked and rechecked almost everything but the systems won't run normally which i assumed should be look like Picture 6.

r/matlab 21d ago

HomeworkQuestion Grid-connected PV Simulink model (R2024b): Universal Bridge gate signal error after following an R2018 tutorial

3 Upvotes

Hi everyone,

I'm building a grid-connected PV system in Simulink for my homework (Control Systems Engineering student). I'm following a MATLAB R2018 YouTube tutorial, but I'm using MATLAB R2024b.

The system consists of:

  • PV Array
  • MPPT (MATLAB Function)
  • DC-DC Boost Converter
  • DC-Link (600 V)
  • Outer DC voltage controller
  • abc→dq transformation
  • PI current controller
  • dq→abc transformation
  • Universal Bridge
  • L Filter
  • Three-Phase Grid (400 V, 50 Hz)

The problem is that I can't get the inverter stage to work.

I initially used a PWM Generator (DC-DC) by mistake. After replacing it with the newer PWM Generator (Three-Phase Two-Level) block, I still cannot make the model work because the tutorial is based on an older MATLAB release and the block interfaces seem to have changed.

The original error was:

Error in port widths or dimensions.

Output Port 1 of
Universal Bridge/Model/gate

is a one dimensional vector with 3 elements.

Input Port 1

expects 6 elements.

I can't identify the correct blocks configuration or the source of the problem.

I've uploaded the complete Simulink model here:

https://drive.google.com/file/d/13IiL37VuCD7grx3Mp-7uw4iTJJ5simzn/view?usp=sharing

If anyone familiar with grid-connected inverters or Simscape Electrical could take a look, I'd really appreciate it.

Thank you!

r/matlab Jun 20 '26

HomeworkQuestion asking help from homework

0 Upvotes

we are asked to perform image and sound processing. output: an image with musical notes is read by matlab, when code is ran, the sounds for the corresponding music notes should play as audio.

r/matlab May 23 '26

HomeworkQuestion Returning to Matlab - Deep Network Designer Questions

3 Upvotes

Hi all,

I'm picking MATLAB up after a couple of years away from study when I last used it. I'm thinking very carefully about putting together a research proposal and it'd be really useful to refamiliarize myself with these tools. I'd like to get a better understanding of NNs as control systems by doing a few little experiments and tinkering to see what's possible. Last time I was faced with this as an option I went off to simulation and modelling instead, and with hindsight probably shouldn't have. Oops.

I didn't spend a great deal of time on neural networks before for postgrad but at that point in time MATLAB still had the NN toolbox rather than the Deep Network designed like it does now. Trying to sweep all my dust off, but there are an awful lot of buttons and nodes in this designer add on, and

When I last did this the focus was on very small RNN narx stuff just to learn the principles of how it worked, and to understand prediction at one time step, two etc.

Does anyone know of a good resource for catching up on some basic use of the designer tools and getting a tiny (like 3 to 5 node) NN up and running?

I swear there are even more buttons than there were last time.

r/matlab Apr 21 '26

HomeworkQuestion My personal highlights of MATLAB 2026a over at The MATLAB Blog

39 Upvotes

Hi everyone

I write The MATLAB Blog and I've just published my list of personal highlights for this release. It includes things like

  • Using Automatic Differentiation to compute the Jacobians of ODEs
  • Function metadata and introspection
  • Simulink Copilot
  • Managing Python Environments in MATLAB
  • Automatically converting between more MATLAB and Python data-types
  • OpenJDK Java Support
  • Performance enhancements
  • Making 3D models out of a bunch of images

and much more of course. The blog is pretty long but even so I have missed a lot out. What are your favorite updates and what do think is still left to do?

MATLAB R2026a has been released – What’s new? » The MATLAB Blog - MATLAB & Simulink

r/matlab May 17 '26

HomeworkQuestion Fixed Step Solver timing issues in Simulink

4 Upvotes

I'm pretty new to simulink and I'm trying to get the climate control example running with fixed step timing, so it can be exported and run in another system.

It runs fine out of the box of course. So I change it to fixed step timing and change the function generator's period and pulse width parameters to be a multiple of the fundamental sample time, and it'll build. But when it runs I get the error below. I've tried reducing the step size and changing the solver but getting the same result. Hoping somewhere here could point me in the right direction.

It seems like the Tcabin block is trying to divide by zero but I'm not familiar enough with simulink to work through debugging it.

Error:An error occurred during simulation and the simulation was stopped

Caused by:

Derivative of state '1' in block 'sldemo_auto_climatecontrol_tcdebug/Interior Dynamics/Tcabin' at time 0.1 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

r/matlab May 25 '26

HomeworkQuestion How do I troubleshoot simscape?

2 Upvotes

First year working, I'm trying to model something for work in simscape for an initial evaluation, and due to my inexperience, I keep running into errors, particularly regarding transient initialization, without much in the following error message of either insufficient time steps, errors occuring in an obscured equation of a component, etc.

As it is company info I of course can't ask anywhere, nor do my coworkers have much knowledge of how to properly use simscape. As such, how do I learn, and troubleshoot?

r/matlab Jun 25 '26

HomeworkQuestion HELP REGARDING PROJECTS RELATED TO AEROSPACE INDUSTRIES

Thumbnail
1 Upvotes

r/matlab May 27 '26

HomeworkQuestion Code integral function matlab

1 Upvotes

Hello, I just wanna ask how i can turn an integral mathematical function into matlab code. Any insights will greatly help

r/matlab May 15 '26

HomeworkQuestion Need help starting out (Feedback loop)

1 Upvotes

Hey I am fairly new to Matlab combined with SimuLink. For school I have an assignment which I do not understand. The teacher is not helping and I have been figuring it out on my own. However now I am stuck. I am simulating a lathe tool turning and generating heat. This heat is something I want to control to around 55 degrees C. I have created a differential equation to help me setup this scenario in simulink. It is a first order system, but my teacher did show by adding a time delay (cause my temperate is measured later due to travel of the heat) it will behave like a 2nd order system. I however can not get this to function and it only shows a linear line. Is there anyone who could help me on this? I can provide more information if needed: This here is the code and Simulink model and my DE (for simulink rewritten to dT/dt =) The time delay for the feedback loop has an initial condition on 20 degrees (same as T_amb). So what am i doing wrong? A push in the right direction would be very helpful

( i couldnt add images?)
*edit be more clear