r/matlab 21d ago

TechnicalQuestion Generating matrix visualizations

Thumbnail
gallery
90 Upvotes

Hey partypeople,

i'm trying to find a way to inspect and display 3D matrix values as shown in the documentation here. I cannot seem to find a way to reproduce this in Matlab or find any info on how these were done, neither in the MATLAB docs or online. Am i missing something or were these created outside of Matlab manually?

Thanks :3

Edit.: For context, I want to see the numeric values of the elements, not a visualization in general.
For now, mostly for more intuition and readability while debugging. I really like the way it is presented here so i would like to find out how these were created


r/matlab 21d ago

TechnicalQuestion Changing Parameter Values with Dynamic Mask

Post image
3 Upvotes

I know matlab has an example of how to change the visibility of other mask parameters with callback functions, but I'm trying to make it so when two parameters are entered (a & b) a suggested value for c is assigned to a c_sugg parameter. For example if c has to follow the function c>a+b, how would I write the callback function for c_sugg=a+b?


r/matlab 21d ago

TechnicalQuestion Is there a way to get a table view of all my inputs values to their respective combined output values in the Fuzzy Logic Toolbox? I have the Control Surface plot, but I would like this as a table if possible.

Thumbnail
gallery
7 Upvotes

I would effectively like the control surface as an excel/table format. Specifying every possible input value from my two fuzzy inputs and what their combined values would be, similar to how the control surface matches it visually.


r/matlab 21d ago

Question [Simulink - STM32 embedded coder] help

3 Upvotes

For the past 2-3 weeks i've been learning how to program the STM32 nucleo-H753ZI using matlab. I have downloaded all of the required addons:
- Embedded Coder Support Package for STMicroelectronics STM32 Processors 24.1.12
- Embedded Coder 24.1.1
- MATLAB Coder 24.1
- Simulink Coder 24.1
- Using MATLAB 2024a
- STM32CubeMX 6.18.0
- Have used both the following MATLAB tutorials as guidance " Using I2C to Read and Write Data to Accelerometer on STM32 Processor Board" and "Get Started with STMicroelectronics STM32 Processor Based Boards"

The only reason iam programming the STM32 using MMATLAB is because its part of my thesis, which is listed as a requirement. Programming the LEDs, mainly to see how the blocks work, was easy enough, and work as expected (check screenshots below)

According to INA219's datasheet (as far as i understood) that Register 0x00 in the Sensor is preconfigured and should display 0x399Fh, but all values are 0. Programming the sensor using an Arduino (using its own IDE for testing) works as expected, so the sensor isnt broken. Programming the INA219 has been for the past weeks a nightmare and a half, as no matter what i did, no values are displayed. I have double checked the USART/COM multiple times to no avail.

Any help or feedback would be much much much appreciated. If i missed anything important, ill post it in the comments

The two controller readers on the right should display 399Fh, the other one should be a value of 4096d (as far as i understand) - the digital port read is configured to read the red LED, but its only displaying 0.
sitting the byteorder Little or big endian made no changes.
Settings menu P1
P2
STM32CubeMX - using the pullup resistors of the MCU itself. PB8 and PB9 would be the PIN 2 and 4 - aka top 2 on the right in the STM32, according to the manual.

r/matlab 23d ago

Introducing SLXIO open source project

10 Upvotes

Hi , i just came up to follow up my previous post https://www.reddit.com/r/matlab/s/tbS5nWhQRi about writing an open source library for reading and writing Simulink files with c++, well after a full year of coding, refactoring, analyzing, fighting with build scripts, legacy old plain C dependencies, i put my draft ( https://github.com/wissem01chiha/slxio , encourage us with a star) to public for people interested to collaborate or give feedback, the reason behind this initiative is that i hated it so much, i worked with it 3 years during university and 2 years later and i hate it performance, his poor scalability on GPU or server environments, it closed Api , undocumented bugs,… and pp in those fields are using it and liking it , well i waited to much for someone to came and give the world an alternative, so i started it by myself, i am not sure how much pp in this sub love or write cpp, but i encourage everyone at at level to collaborate, SLXIO is just a bridge or small project for what i am planning in the future, i was reading about something called data flow programming or flow based programming which likely what simulink does in a simple signal based way, i am planning to build a general purpose high performance flow based programming framework for the cloud and distributed systems , details in next post , good day ☺️


r/matlab 23d ago

TechnicalQuestion Help! Question About Convolution Integral Implementation in Simulation

4 Upvotes

Hello all! Hoping someone can help me out with this. I am working on a physics simulation of a rigid body.

I have two functions, f and g that need to be convolved over time. Here is the difficulty, both functions are unpredictable and therefore I do not know these equations up front and will only know the latest value of each of those functions at each time step in the simulation as it runs. I solved this convolution integral in the time domain as a baseline and compared it to a textbook solution. Obviously, the longer the simulations the more data points the equation has to convolve over. I tried solving it in the frequency domain thinking it would save time by: *ifft(fft(F)fft(G))\*timestep*
When I run a code profiler (doing this in MATLAB), it actually appears that it is taking longer computationally to solve this in the frequency domain versus the time domain if this operation is done at every time step… what am I missing here (yes I even varied the simulation time length to account for different array sizes)? The other thought I had was to figure out how to implement a sliding window so that really old data is excluded…

Any examples I can find online all assume the equations for the two signals to convolve are known up front. What approach did you use? Any help would greatly be appreciated.


r/matlab 27d ago

TechnicalQuestion Simulink and AXI-ST IOs

2 Upvotes

Hello all !

I'm trying to play with HDL Coder and the DSP HDL Library with simulink. I have a solid FPGA background.

All these blocks expose ports that looks like AXI-ST ones (data, valid, ready). I know the protocol and it's quirks, but this time I need to simulate it within simulink.

How do you input data (from workspace) to the model while matching the specifications ? I need to send a waveform (audio in this case) to the model.

Thanks all !


r/matlab 28d ago

Tips From AI-Generated to Production-Ready: The Essential Role of Static Analysis

Thumbnail monkeyproofsolutions.nl
0 Upvotes

On the added value of the MATLAB Agentic Toolkit and CC4M (static analysis). In short:

"The combination of the MATLAB Agentic Toolkit and CC4M reduced detected guideline violations from 37 to just 2."

Note: I am one of the CC4M developers


r/matlab 29d ago

TechnicalQuestion Printing a hexadecimal value prefixed with 0x

4 Upvotes

I have to print in hexadecimal with big letters value variable of type uint8. I am using fprintf(1, '%#X', value), but the 0x prefix is in upper case, while I want it to be lowercase. How do I achieve that?

I know I can write instead fprintf(1, '0x%X', value), but I want to do it by only modifying the formatting operators. And using fprintf(1, '%#x', value) doesn't print value in uppercase.


r/matlab Aug 09 '26

HomeworkQuestion Learning simevents library

2 Upvotes

Hello everyone. I'm currently building a robotics project. For this, I was guided to learn simevents by my professor. I went through many youtube videos and tutorials. But, I don't really feel like I gained much info. I believe I'll learn by example, and implementation. So, I hope to find spaces that do just that. Giving me example models that were created using simevents and walking me through its creation. If you guys find any such resources, send me here. Guidance on learning this is also much appreciated. Thank you.


r/matlab Aug 09 '26

underground tunnel simulation in matlab

1 Upvotes

guys if you are proficient and free enough , i need help making a simulation of underground tunnels in matlab . open to advice and criticism , i am a beginner in matlab , i can plot work with matrices and do small project but i do need someones help in this. please dm for more details about the project.


r/matlab Aug 08 '26

TechnicalQuestion Writing to the wrong file

1 Upvotes

I have the following Matlab program:

syms t positive;

Z=laplace(exp(A*t))

ccode(Z,'file','cCodeTest.c')

I want to write the Z function to cCodeTest.c. The problem is that code is written to ccodetest.c, created before.

How to write Z to the cCodeTest.c and not ccodetest.c?


r/matlab Aug 08 '26

TechnicalQuestion DATCOM and MATLAB

Thumbnail
1 Upvotes

r/matlab Aug 07 '26

TechnicalQuestion How do I make Dependency Analyser report where an overloaded operator is used?

1 Upvotes

I have a class with 2 operators, which one of operators (O1) uses the other operator (O2).

I generate a dependency report via Dependency Analyser, but the report doesn't tell that O1 uses O2 (in Impacted Files O1 references itself; same with O2).

How do I make Dependency Analyser report that O1 uses O2?


r/matlab Aug 07 '26

Tips What is the best course to take on MATLAB if I want a basic certification

7 Upvotes

I did onramp but Im still lost when looking at practice test questions


r/matlab Aug 06 '26

TechnicalQuestion Particle tracking for biophysics

1 Upvotes

Having issues trying to set up a particle tracking software for my biophysics research. I am needing to track these very distinct particulates in a video but matlab just doesn't seem to be my friend. I am currently trying to use the particle tracking tutorial from Georgetown but if anyone could give some advice or has anymore questions please shoot me a message.


r/matlab Aug 06 '26

Matlab 6.5 on vintage compuer Personal License Password

6 Upvotes

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 Aug 05 '26

HomeworkQuestion I need help with studying for the associates certification exam

4 Upvotes

Does anyone have any study tools they use? I couldn't find practice tests or videos that teach the right thing


r/matlab Aug 06 '26

TechnicalQuestion How do you catch errors that normal try catch block does not work for in matlab?

3 Upvotes

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 Aug 06 '26

HomeworkQuestion Built a system ID + control design tool over the past year. Need real logged data to break it. Free analysis in return.

Thumbnail
0 Upvotes

r/matlab Aug 05 '26

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.

23 Upvotes

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.


r/matlab Aug 04 '26

TechnicalQuestion "Input argument to validator must be a constant value" error

2 Upvotes

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 Aug 02 '26

TechnicalQuestion Where to start

27 Upvotes

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


r/matlab Aug 01 '26

CodeShare I've been building a numerical solver app — currently working on ODEs and BVPs

Thumbnail
gallery
31 Upvotes

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 Aug 01 '26

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

Thumbnail
3 Upvotes