r/matlab • • 13h ago

Absolute square of complex matrix trick.

0 Upvotes

I often need the absolute square of a complex matrix.
There are several options. I prefer an inline function like abssq(m) ;-).

conj(m).*m,
abs(m).^2m
real(m).^2+imag(m).^2

abssq = @(m) m.''.*m

r/matlab • • 8h ago

self-promoting Light MATLAB/Octave interpreter that runs entirely in your browser

Post image
20 Upvotes

I've been working on a hobby project called Matro. It's a MATLAB/Octave-compatible interpreter written in Rust that compiles to WebAssembly, so you can run .m code in the browser with nothing to install.

If you wanna try it:
https://kitakitaaura.github.io/matro/

Source: https://github.com/kitakitaaura/matro

It isn't a MATLAB replacement, and I'm still working on adapting many toolbox functions that are missing or only approximate.

Tons of problems still, feel free to report anything breaking.