Convert Matlab Algebraic Sol to C compatible
So I am currently working on converting an FEM simulation which was first coded in MatLab (easy testing) into C, in order to improve frame rates, etc.
Now of course C isn't nearly as math friendly. A certain portion of the code has some fairly hairy integrals, which were solved at run time by the MatLab version. As opposed to implementing a numerical solution in C, I had the idea of producing the analytical solution (simple algebra) in Matlab and dumping this over to C. However there is some issue between notations, for example:
In Matlab the following expression:
is equivalent to
Ke = [ 16000/94354/a*b ]
note that 'b' is actually in the numerator. Now if the solution was as simple as this it would be no problem to convert, however the actual solution is an 8x8 matrix of expressions like:
So my question is, does anyone know exactly how the matlab notation works, or a relatively straightforward way of converting it to an equivalently evaluated C expression?
Any help is appreciated! (Note that changing the ^2 is quite easy)