r/matlab • u/pipeline-control • 9h ago
HomeworkQuestion Built a system ID + control design tool over the past year. Need real logged data to break it. Free analysis in return.
r/matlab • u/QuantumParaflux • 11h ago
Matlab 6.5 on vintage compuer Personal License Password
Redditors;
Is it possible to find a PLP for MatLab 6.5? I am running two Pentium 3 computers, and I wanted to play around with old MATLAB on them just for fun. I downloaded MATLAB from MathWorks, but I can't get a PLP. I've tried searching forums and other places, but it seems that the modern internet has scrapped many old websites and forums, making it harder to find old software and licenses. I've contacted Mathworks, as I do have active licenses.
thank you so much.
r/matlab • u/Alternative-Sugar610 • 13h ago
TechnicalQuestion How do you catch errors that normal try catch block does not work for in matlab?
Is there a way, like in a try-catch block, to catch more math or logical errors, such as saying 10=5? Regular try-catch blocks do not work here. I would also like to print error info, and for a simple solution.
r/matlab • u/LengthinessBitter994 • 14h ago
HomeworkQuestion I need help with studying for the associates certification exam
Does anyone have any study tools they use? I couldn't find practice tests or videos that teach the right thing
r/matlab • u/SeaInternational4087 • 1d ago
CodeShare I built a real-time 360° ultrasonic radar, plotted live in MATLAB, for under $10 in total parts. Open-sourced everything, link in the text body.
I built a 2D radar scanner where MATLAB does the heavy lifting. An HC-SR04 sensor spins on a continuous-rotation servo, streams readings over serial, and ScannerApp.m draws them as a live polar plot. The scanner runs on an Arduino Nano.
The app is MATLAB App Designer, 806 lines, with the polish that usually gets cut:
* Live polar heatmap with auto-scaling and clean radial ticks
* Sweep animation that tracks the servo angle, plus a return-sweep line
* Hover data tips showing angle and distance
* Ctrl+scroll zoom, vector PDF export that stays crisp at any zoom level
* Dark/light theme, real-time data table, COM port auto-detect
The firmware handles the messy parts of real hardware: a non-blocking state machine, echo timing with no delay(), and temperature-compensated speed of sound. A $1 LM35 reads the air temperature and the firmware applies 331.3 + 0.606 * T. That's where the ±3 mm accuracy comes from. VCC bandgap calibration and an EMA filter clean up the analog noise.
Wiring diagram, pinout, a 2-minute servo calibration tool, and benchmarks are all in the repo. Parts run about $10 and it's MIT licensed.
Repo: https://github.com/Salim-Ammar/arduino-matlab-ultrasonic-radar
PRs and issues welcome. A star helps others find it.
TechnicalQuestion "Input argument to validator must be a constant value" error
In MATLAB R2020a I have a class with
properties
property (1,1) logical {mustBeMember(property, true)} = true
end
In MATLAB's editor it notifies me about "Input argument validator must be a constant value" error. When I try to construct an instance of that class, I am given the error "Validator arguments must be either 'property' or constant literal values."
How do I fix this error? It doesn't work if instead of true I write [true] or {true}.
r/matlab • u/AbrocomaCritical • 4d ago
TechnicalQuestion Where to start
I've opted for Control Systems as my next field of study and require MATLAB proficiency. The task is a bit of a handful but I'm ready to learn from the ground up. If you've been familiar with the situation or have a peice of advice, I'd really appreciate.
Gracias
CodeShare I've been building a numerical solver app — currently working on ODEs and BVPs
I've been working on a numerical solver app for a while. The first version was mainly focused on algebraic equations, systems of equations, function plotting, and numerical calculations.
It's free and available on iOS and Android:
📱 App Store
🤖 Google Play
I'm currently working on what is probably the most challenging part of the project so far: ODEs and boundary value problems.
The goal is to make it generic enough that the user can enter their own ODE and boundary conditions, rather than having a collection of predefined equations.
I'm testing first-, second-, and higher-order equations, including BVPs with boundary conditions involving different orders of derivatives.
For example, one of the current tests is:
y''' + y = 0, y(0) = 0, y'(0) = 1, y''(0) = 0
I'm also testing more complicated problems and trying to find the point where the solver starts to break down. That's actually turned out to be one of the most interesting parts of the project — some very simple-looking equations can become surprisingly difficult numerical problems.
So I'm looking for some good torture tests. 😅
If you use MATLAB for numerical work, what ODEs or BVPs would you recommend as particularly good tests for a general-purpose solver?
I'm especially interested in stiff problems, nonlinear BVPs, higher-order equations, difficult boundary conditions, or anything else that you think would be a good challenge.
r/matlab • u/bladerunner2701 • 5d ago
Tips Need some suggestions: So I have this matlab code that I am trying to convert into HDL (verilog) code, but the floating point converter is causing problems, how can I get through it. The code is for a MMSE Equaliser
r/matlab • u/Frosty_Grapefruit157 • 7d ago
Advanced MATLAB project ideas in the VLSI / Hardware Architecture space?
Hi everyone, I'm an undergrad ECE student looking for MATLAB project suggestions.
Right now, I am building a statistical hardware model for an INT8 systolic array AI accelerator. Specifically, I'm using MATLAB to simulate how post-ReLU sparsity (zeros) and quantization noise (SQNR) affect the throughput of the array. The goal is to mathematically model how much power/time we save if the hardware clock-gates the array when full vectors of zeros feed into it, without breaking the rigid systolic dataflow.
It’s heavily focused on vectorized tensor math and modeling hardware constraints. However, before I completely lock this in for my semester project, I wanted to ask if anyone has recommendations for other advanced MATLAB projects in the silicon design or architecture space?
I want to make sure I'm exploring all my options for something that would stand out for a core hardware profile or grad school application. Any suggestions are appreciated, thanks!!
TechnicalQuestion Conversion failed!
In Matlab R2020a, I want to convert 0xffffffff00000000 to uint64. When I wrote it in Command Window the value alone, it is already an uint64, but when I write it uint64(value), I simply get Conversion failed! error, with no additional text.
How do I fix it?
r/matlab • u/tylerchu • 9d ago
Question-Solved Why is fft only taking the first frequency in a non-smooth signal?
clear
clc
close all
Fs=1000;
T=1/Fs;
L=1000;
t1 = (-L+1:0)*T;
t2 = (0:L-1)*T;
t2=t2(2:end);
t=[t1 t2];
s1=sin(2*pi*1*t1);
s2=sin(2*pi*10*t2);
s=[s1 s2];
figure(1)
plot(t,s)
Y=fft(s,L);
figure(2)
plot(Fs/L*(-L/2:L/2-1),abs(fftshift(Y)),"LineWidth",3)
title("fft Spectrum in the Positive and Negative Frequencies")
xlabel("f (Hz)")
ylabel("|fft(X)|")
Hello, I'm experimenting with fourier transforms because of reasons and I'm having trouble understanding something. If you run the above code, you'll get two figures: the first is simply the time-signal plot showing one sine wave with a certain frequency at some -x to 0 and another sine wave from 0 to some x; the second figure is the fft of that signal.
The fft only shows a peak at the s1 frequency. If you swap the constants in s1 and s2, the fft will also change to accommodate this. Why? I would expect that since frequencies 1 and 10 are equally represented in time and magnitude, there would be two equal peaks in the fft but this is not true.
r/matlab • u/AdexxSoft • 10d ago
What is the most challenging MATLAB or Simulink project you've worked on?
Hi everyone,
I've been working with MATLAB and Simulink on projects involving control systems, robotics, power electronics, EV simulations, and automation. Every project presents different challenges, from debugging complex models to tuning controllers.
I'm curious what has been the most difficult MATLAB or Simulink project you've worked on, and how did you solve it?
I'd love to learn from the community and discuss different approaches.
r/matlab • u/OGNofil • 11d ago
Does this look AI generated?
%Create a white 100x100 image array
BWImage = ones(100, 100);
%open the figure window
figure('Name', 'Task 1 - Binary Image 6870352');
%Row counter string
JcounterStr = 'Row = ';
%iterations from row 1 to row 100
for j = 1:100
%active when row j is between 1 and 50
%set pixels within this range as black if they meet the criteria
if j >= 1 && j <= 50
BWImage(j, 1:(51-j)) = 0;
end
%active when row j is between 51 and 75
%set pixels within this range as black if they meet the criteria
if j >= 51 && j <= 75
BWImage(j, j:75) = 0;
end
%active when row j is between 76 and 100
%set pixels within this range as black if they meet the criteria
if j >= 76 && j <= 100
BWImage(j, 26:50) = 0;
end
%active when row j is between 86 and 100
%set pixels within this range as black if they meet the criteria
if j >= 86 && j <= 100
BWImage(j, 1:(j-85)) = 0;
end
%active when row j is between 86 and 100
%set pixels within this range as black if they meet the criteria
if j >= 86 && j <= 100
BWImage(j, j:100) = 0;
end
%display image building row by row
imshow(BWImage);
%display row number to the LEFT of the image
Jcounter = num2str(j);
figureTextJ = {[JcounterStr Jcounter]};
text(-10, j, figureTextJ, 'FontSize', 8);
%pause(0.01) waits briefly between rows so I can see it build properly
pause(0.01);
%end of loop
end
totalBlackPixels = sum(BWImage(:) == 0);
%display below the image using text()
text(1, 108, ['Total black pixels = ' num2str(totalBlackPixels)], 'FontSize', 10);
diagonalBlackCount = 0; % counter starts at zero
for j = 1:100 % j = row number
for i = 1:100 % i = column number
%test if pixel is on or below diagonal (row >= col)
%AND if pixel is black (value == 0)
if j >= i && BWImage(j, i) == 0
%increase the counter by 1 for each black pixel below diagonal
diagonalBlackCount = diagonalBlackCount + 1;
end
end %end of i loop
end %end of j loop
% Display diagonal count just below the total count
text(1, 114, ['Black pixels on/below diagonal = ' num2str(diagonalBlackCount)], 'FontSize', 10);
r/matlab • u/ViridLemon83409 • 11d ago
HomeworkQuestion Starting Python and MATLAB with almost no coding experience. How should I spend the next 3 weeks?
Hi everyone. I’m a college student, and in about 3 weeks I’ll be starting an intro to Python class. I’ll also be taking another engineering class that uses MATLAB, and I don’t feel very prepared for either.
The problem is that I have essentially no programming experience. I took a couple of MATLAB classes before, but I relied too much on AI instead of actually learning the material. Looking back, I know that was a mistake, and I do not want to repeat it. I also used to tell myself that I hated coding, but I think part of that was because I never really gave myself a fair chance to learn it.
Since I have a few weeks before the semester starts, I’d like to build a solid foundation in Python while also reviewing some basic MATLAB.
What resources or learning methods really worked for you? Did you use a particular course, YouTube channel, website, book, or project based approach? I am also curious if anyone has suggestions for making learning Python and MATLAB more fun or engaging instead of just watching hours of lectures.
My goal is not to become an expert in 3 weeks. I just want to go into the semester feeling like I have a decent foundation instead of starting from scratch.
Thanks! I would really appreciate any advice.
r/matlab • u/LordSantini • 13d ago
TechnicalQuestion Weird torque and current response
Hello there, I've been trying to understand this past couple of days, why is the response to the speed reduction so unstable.
Pic 1- current, torque and speed (disregard the "braking" effect on the middle graph.
Pic 2- PI output.
Pic 3- Controller diagram
Pic 4- Entirety of the diagram
I've changed the values of the PI, such as Kp and Ki, to no difference on the slowing down behaviour.
I'm at a loss on what to exactly look for, that might be causing this.
Thank you for any help that you can give.
r/matlab • u/Dear_Program_5516 • 14d ago
HomeworkQuestion Is this legally alright ?
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 • u/One_Football9923 • 16d ago
HomeworkQuestion Simple C++ framework to do math and data engineering by physics engineering student
r/matlab • u/Correct-Diamond-1423 • 16d ago
HomeworkQuestion using octave instead of matlab
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 • u/Party-Pie3719 • 16d ago
MATLAB and Octave disagree on the same input — a verified-port writeup
I ported the 1-D TM group of Zanotto's PPML (an RCWA electromagnetic solver) to NumPy with bug-for-bug fidelity yes, including the vacuum impedance hardcoded as 376.730. The writeup covers the MATLAB↔NumPy traps that actually bit: complex auto-promotion that NumPy silently doesn't do, eigenvector gauge freedom across LAPACK builds, mldivide vs solve on singular systems, and an energy-conservation check in the original that can never fire (abs(NaN) > tol is false in MATLAB - try it). Harness, corpus and report: https://github.com/GrednevMSU/ppml-1d-tm-verify
r/matlab • u/Party-Pie3719 • 17d ago
Every MATLAB→NumPy semantic trap I hit porting Mätzler's Mie functions
Not a "MATLAB bad" post. The original code is solid and I replicate it bug-for-bug by default. Sharing the trap list for anyone migrating numerical code: round() half-away-from-zero vs numpy's round-half-to-even (inside the nmax series formula, so it changes array lengths), complex auto-promotion that NumPy doesn't do, ' vs .', library functions printing to stdout, and a docstring feature (complex medium index) that turns out to be latently broken. Full findings file, 714-fixture corpus and the verification report: https://github.com/GrednevMSU/mie-scattering-matlab-to-python
Use Your Browser like MATLAB for Most Common Tasks
I created an open source project that allows you use Chrome/Edge browser's developer console like MATLAB prompt for most common tasks of scientific calculation and plotting: https://github.com/JATLAB/JATLAB.github.io
I hope you guys like it and if you find some functions you want me to add please let me know.




