Hello!
No easy way, though matrix seems very intuitive and simple for a client they are devious,crooked for a programmer.
They hide insidious issues… Sorry,didn’t meant to scare you, but pay attention.
The can lead to memory/CPU leak, wrong behaviour…
That said, you can overload operators to add matrix operations.
Or you can make your own matrix type… I suggest to make a one dimensional array and add logic to mimic matrix behaviour… For example… If you want a 5x5 make an array of 25 and use X+Yx5 formula to access elements