So I have 2 matrices: each is 100×100.
I am looking to calculate a 3rd matrix such that: M3[i]=sqrt(M1[i]^2 + M2[i]^2).
I can obviously do ForLoops but I am sure there is something faster.
I digged into the accelerate framework and got lost in Linpack world
Any help to get me on the right track…
Thanks
The Accelerate framework is a good idea.
You could use a function like vDSP_vsq to operate on one column of the matrix at a time, placing the result in the corresponding column of M3. You might have to make two resultant matrices (one which will be M1^2, the other M2^2), and then add them to form the correct M3 result matrix by adding the columns with a call to vDSP_vadd which, again, will be able to operate one column at a time.
There is sample code (showing how to add two vectors, etc) here at the Apple developer page.