The timer function is exactly what you want. If it seems too complicated, start at the beginning of the MATLAB documentation and by the time you get to timers, it will make sense.
If the equations are pre-determined and only coefficients need to be determined, then you can use matlabFunction() to generate the MATLAB Code into a file. Then set up your program to not generate the equations and instead call upon the pre-saved MATLAB to determine the results. This second program can then be compiled.
Best Answer