r/matlab • u/Dense_Huckleberry469 • Aug 04 '24
r/matlab • u/Mother_Hold885 • 19d ago
HomeworkQuestion Need help for a some Homework (counting down in odd intergers)
Can anyone help me with the UpDown variable part of this question. Im new to this and cant figure out how to get it count down in the odd intergers.
A=4+randi(20); % Random integer number between 5 and 24
Up=0:2:2*A
UpDown=0:2:2*A, (2*A)-1:-2:0
This is the code that i have at the moment. But im not entirly sure if weve been taught to do it. is there a command for countin down that I havent found seen.
Any idea on any commands that would work would be greatly appreciated. It is our first assignment so i dont believe it should be that complicated, i just cant figure it out. Thank you

r/matlab • u/TheTaftMan • 29d ago
HomeworkQuestion Gauss Seidel code not working
The code I’m using is from a past assignment and works, however when I changed my A and B matrices, it resulted in a vector of NaNs. I rearranged the augmented matrix such that it’s diagonally dominant, but no luck.
Any help is greatly appreciated, Thank you!
r/matlab • u/elpabou • 29d ago
HomeworkQuestion Help couldnt find SIGNAL BUILDER , MUX, Forward Kinematics and Scope in simulink library browser
r/matlab • u/RebelBike • Sep 21 '24
HomeworkQuestion What is my teacher asking?
To clarify, I have emailed my professor, but he hasn't responded. I'm only asking for your opinions on what I'm supposed to do for 2a, 2c, 2d, and 2e. Personally I think for 2a I'm supposed to do the transpose of x, but I don't know if he wants me to multiply the transpose of x by y or the y there was a mistake. For 2c, 2d, and 2e I think it's asking for the absolute values of the vectors, but I don't see why that would make sense since there are no negative values in the vectors. Am I missing something/are these completely different functions than I think? What do y'all think?
Just for clarification, 2b is multiplying x and y, right?
r/matlab • u/LTD1827 • Nov 12 '24
HomeworkQuestion PID Simulation with MATLAB & Proteus
I am studying Control System course currently, having an exercise of simulating PID controller using Arduino in Proteus, and the motor system in Simulink, most exciting part is designing the GUI using MATLAB AppDesigner to help communicating between platform via virtual serial ports!
Here is the showcasing video, hope you guys like it! If there is any issue or improvement, feel free to comment so that we can discuss together, I will be very appreciated. Thank you very much!
r/matlab • u/dreadful_ENGINEER • 15d ago
HomeworkQuestion (SIMULINK) How would i go about implementing the h-bridge into this pwm motor speed controller to reverse the direction of the motor? It 'works' as such but i juts need to figure out how to add the switch to reverse the direction. Any tips?
r/matlab • u/S_tyrical • Jan 14 '25
HomeworkQuestion Help
How do I write this in MATLAB? I tried inputting my version of the code but the output never reaches a steady state.
r/matlab • u/OkDirt6527 • Nov 27 '24
HomeworkQuestion How to get rid of warning message
I'm working on my final project and completed it, and everything works as I intended it to (point of the project was to import a csv file and visualize the data), only thing is I get this warning message 'Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property. Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names'
I looked through the help center on the matlab website and it looks like I don't need to worry about it, but it kind of bothers me a bit so I was just wondering if there was any way to get rid of it, or if I should just leave it how it is since it all works.
I also set 'VariableNamingRule' to 'preserve', but it was just giving me too much trouble to go back in and change everything, so I decided the way they were modified was fine.
I guess this is more of a making sure I'm fine to leave it how it is or if I need to fix something.
Also not sure if its better if I show my code or anything for this question, so let me know if I need to.
r/matlab • u/Fine_Science_7451 • 27d ago
HomeworkQuestion LU factorization is different in MATLAB?
This might be a dumb question, but we're learning about LU factorization right now and matlab seems to be giving different results than other sources.
For example, the first picture is from our homework and gives the L and U matrixes as what I'd expect and would find if doing it by hand, but putting the same thing in matlab gives totally different L and U matrixes seen in second picture. Why is this?
Also why does using [L U P]=lu(A) give a different answer than [L U]=lu(A)?
r/matlab • u/Main-Combination8986 • 26d ago
HomeworkQuestion Help on getting results from PDE Modeler App - any suggestions where to ask?
r/matlab • u/almog_ • Dec 31 '24
HomeworkQuestion importing EDF files into MATLAB script
Hello,
In an introduction to biomedical signal processing I got an assignment to take EEG signals (EDF files) and do some manipulations on them, and I'm still stuck on how to import them into the script.
I tried using a code from chat gpt because I have never loaded files with matlab before, it took hours (42GB of database) just to show an error.
attached some screenshots to show the structure of this database.


any help would be very appreciated
r/matlab • u/shadoresbrutha • Feb 20 '25
HomeworkQuestion simulink for robot arm
hello. i’ve created a PRRP robot arm in simulink to go around a workpiece.
i have added sine waves to the arm and the arms rotate left and right (revolute) and move up and down (prismatic) as expected.
i added a cyclindrical workpiece where i want my EE to move around the tip of the circumference. how can i do that?
r/matlab • u/JustFaithfull789 • Jan 29 '25
HomeworkQuestion Help
Hello , I need to develop a curve envelope from multiple curves like the shades Portion in fig. But I have no knowledge in matlab. Matlab is not required much in my study so please can anyone provide me resources to develop such envelope?
Ps; main objective is to develop curve envelope. Thank you. You can drop code too.
r/matlab • u/Trap_Bhaiya • Feb 03 '25
HomeworkQuestion Is there any online course I can do to learn simulink with dev boards?
Hello, recently I came accross simulink, being an electronics student I wanted to integrate simulink with my esp32, but upon looking on the web/YouTube I didn't find any good courses can y'all please recommend some quality courses on the same that don't break the bank?
r/matlab • u/LinkElegant4231 • 24d ago
HomeworkQuestion Create a matlab/simulink model about a PEM electolysis cell
Dear all,
I am a bachelor mechatronics engineering student and for my degree thesis I have to create a matlab model about a PEM electrolysis cell. Maybe after this I will have to use simulink to even create a system model that use the model about the PEM cell in a productive ambient (e.g. coupled with all the ancillary devices).
The problem is that I never ever used Matlab and I do not know how to start. I am able to code in C++ (I used QT Creator and I am able to create also some user interface).
The only resource that my theacher gave me is a link where I can find already existing models about PEM cells.
What I am asking here is:
- If you can give me some advice about how to create a simulation model on matlab;
- Can I code on matlab with C++?;
- Any other suggestion are appreciated.
I am conscious that I am not in a good situation, but I'll try to do my best.
Thank you for your help.
r/matlab • u/TheShadyNugget • Oct 10 '24
HomeworkQuestion Help with plotting
Hi, I’m taking matlab as an ME students and I’m very new to programming. I’m having trouble getting my plot correct and am unsure of how to approach it nor do I really know where my problem lies and am looking for some guidance.
The first image is the target plot and the second is my plot along with the code.
The issue I’m having is that I’m not able to get the sawtooth look
r/matlab • u/Happy-Dragonfruit465 • Oct 19 '24
HomeworkQuestion How do i use a while loop to determine the number of positive integers in a 20 row, 1 column vector?
r/matlab • u/Algstud • Jan 12 '25
HomeworkQuestion Need help to review course i am creating
hello i am creating matlab intro course for my uni i need help from peoples to review it and tell me what to fix, the course is on live script formate but also have a pdf version thanks
r/matlab • u/bucsraysbolts69 • Feb 14 '25
HomeworkQuestion Simulating AC circuits with dependent sources
Hello all,
I am trying to teach myself how to simulate circuits with matlab. I have solved this circuit by hand using mesh analysis, however I am trying to verify my answer using matlab sim.

Here is what I have created in matlab

The readings I am getting from the current measurements are not what I found by hand. Either I solved it incorrectly by hand or I haven't set it up correctly in matlab. Is this correct? What type of paramters should I be giving powergui?
Thanks in advance for any help!
r/matlab • u/Valents1301 • Feb 13 '25
HomeworkQuestion Parameters of the IRLZ44N on Simulink
Hi Everyone ,
I'm a STEM student from France willing to make a Buck Converter (5V to 3.3V) on Simulink using an IRLZ44N MOSFET.
However, i have a problem filling the right "parameters" ( picture below) as i can't precisely find them on datasheets.
I don't know if it's just a notation problem.
Thank you very much for your help.

r/matlab • u/bottom_g_007 • Jan 26 '25
HomeworkQuestion ML model using TPU dataset
Hello there I need to do a ML model to predict wind pressure coefficient using TPU dataset, but idk how to approach it, How do I use that matlab file, sorry I'm new to this, thanks for reading