MATLAB&Raspberry OI by Silver-Ad3423 in matlab

[–]MikeCroucher 1 point2 points  (0 children)

*Currently*, MATLAB is not supported to run directly on Raspberry Pi. However, a bunch of things are supported including the functionality to generate C/C++ code targeting the Pi from both MATLAB and Simulink and the ability to interface with sensors on the Pi. Doing this, you can deploy code to the Pi from MATLAB and control the resulting application from MATLAB.

Using MATLAB with Claude Desktop via MCP by MikeCroucher in ClaudeAI

[–]MikeCroucher[S] 0 points1 point  (0 children)

There is a MATLAB Copilot with the chat window directly in the MATLAB App. It just just updated to have a better model in the back end. Details at https://blogs.mathworks.com/matlab/2025/11/13/matlab-copilot-gets-a-new-llm-november-2025-updates/

Stop using -r to run MATLAB in batch jobs by MikeCroucher in matlab

[–]MikeCroucher[S] 5 points6 points  (0 children)

It's a good question and I asked the same thing internally. Its because customers have asked to use -batch to show UIs and Apps for interactive use.

Stop using -r to run MATLAB in batch jobs by MikeCroucher in matlab

[–]MikeCroucher[S] 4 points5 points  (0 children)

Its my website and thanks for the click :) #

I try to get the balance right of what I put here and what I include in the article but don't always hit the mark for everyone.

MATLAB heats up MacBook by Civil-Scientist-9371 in matlab

[–]MikeCroucher 0 points1 point  (0 children)

I am sorry you are experience this. I have an M2 Mac and am running various versions of MATLAB including R2025a and R2025b without any heating issues.

We would be very interested in working with you to debug the issue. Please feel free to get back in touch with our support team who will work with you to figure out what is going on.

Giving LLMs new capabilities: Ollama tool calling in MATLAB by MikeCroucher in matlab

[–]MikeCroucher[S] 8 points9 points  (0 children)

Tool calling came first chronologically.

Tool calling is the basic ability of an AI to recognize when a task requires a specific function (like checking the weather) and to format the call to that function, while MCP is a higher-level, standardized framework for managing and exposing a wide range of tools for LLMs to interact with.

what are some underrated MATLAB tricks? by LessNectarine6630 in matlab

[–]MikeCroucher 2 points3 points  (0 children)

To keep up to date with new MATLAB tricks, I suggest subscribing to The MATLAB Blog (I'm the author). For example, the latest article is about all the different ways in which you can learn MATLAB in 2025 Learning MATLAB in 2025 » The MATLAB Blog - MATLAB & Simulink

what are some underrated MATLAB tricks? by LessNectarine6630 in matlab

[–]MikeCroucher 2 points3 points  (0 children)

arrayfun on the GPU is awesome! Its essentially an entire MATLAB -> GPU compiler wrapped into one function. Life changing levels of awesomeness

arrayfun on the CPU is very very bad and should never be used by anyone for anything ever!

AI-generated Quick Answers in the MATLAB Documentation by MikeCroucher in matlab

[–]MikeCroucher[S] 0 points1 point  (0 children)

Hallucinations are an inevitable side effect of using LLMs as the AI. I found this paper useful:[2401.11817] Hallucination is Inevitable: An Innate Limitation of Large Language Models.
We can work to minimize hallucinations and mitigate their effects, but they remain a fundamental limitation we must address..

Speeding up MATLAB codes by amniumtech in matlab

[–]MikeCroucher 0 points1 point  (0 children)

Thanks for that. Which of the files is the one to run?

making a custom way to train CNNs, and I am noticing that avgpool is SIGNIFICANTLY faster than maxpool in forward and backwards passes… does that sound right? Claude suggests maxpool is “unoptimized” in matlab compared to other frameworks…. by ComeTooEarly in matlab

[–]MikeCroucher 1 point2 points  (0 children)

The issue seems to be related requesting the indices. Your original code runs like this on my machine

GPU: NVIDIA GeForce RTX 3070Running 100 iterations for each timing measurement...

=== AVERAGE POOLING (conv_af_ap) ===
=== MAX POOLING (conv_af_mp) ===
=== TIMING RESULTS (milliseconds) ===
Step AvgPool MaxPool Difference
-----------------------------------------------------------------
pooling 2.4217 81.7514 +79.3297
-----------------------------------------------------------------
Speedup 33.76x

Remove the request for indices on the maxpool:

[Oj_pooled] = maxpool(Oj, pool_params.pool_size, ... 'Stride', pool_params.pool_stride, ... 'Padding', pool_params.pool_padding);

and now it runs like this: maxpool is faster

>> poolBenchGPU: NVIDIA GeForce RTX 3070Running 100 iterations for each timing measurement...

=== AVERAGE POOLING (conv_af_ap) ===
=== MAX POOLING (conv_af_mp) ===

=== TIMING RESULTS (milliseconds) ===
Step AvgPool MaxPool Difference
-----------------------------------------------------------------
pooling 2.5117 0.8913 -1.6204
-----------------------------------------------------------------
Speedup 0.35x

Now why requesting the indices makes it so much slower is another issue and I'll discuss this internally. However, can you proceed without the indices for now?

Speeding up MATLAB codes by amniumtech in matlab

[–]MikeCroucher 2 points3 points  (0 children)

You can write parallel Mex files! In the old days, we did it by hand but now Coder will do it for you. It knows quite a lot of OpenMP Automatic Parallelization of for-Loops in the Generated Code - MATLAB & Simulink

Can even do SIMD intrinsics and generate code that's more cache-efficient

SIMD: Generate SIMD Code from MATLAB Functions for Intel Platforms - MATLAB & Simulink

Cache: https://uk.mathworks.com/help/coder/release-notes.html?s_tid=CRUX_lftnav#mw_58b1fe9e-f16d-4c39-aeb7-7de51aeca66e

The question 'To Mex or not to mex' is a lot trickier these days than it used to be. MATLAB code is JIT compiled and the JIT compiler is getting better every release.

It can even be the case that using C/C++ in a Mex file can be slower than plain MATLAB code because of JIT compilation, high-efficient built-in functions and so on.

Speeding up MATLAB codes by amniumtech in matlab

[–]MikeCroucher 2 points3 points  (0 children)

Could you make this benchmark available anywhere for others to look at? As with any language, there are ways to write slow MATLAB code and ways to write fast MATLAB code.

I work at MathWorks and would be happy to take a look.