This is a pretty straight forward job...
I have two functions written in Matlab that want to translate into pure C code.
No C++. No Matlab automatic Compiler. Human coded.
The Matlab functions are called method1.m and method2.m
The equivalent C functions should have the following headers
void* method1(double *x, double *n, int dim, double * scrap);
void* method2(double *x, double *n, int dim, double * scrap);
The C functions should NOT use malloc or any kind of memory allocation
inside. All required temporary memory should be preallocated in scrap
before calling the function.
The C functions should follow the same code flow as the Matlab function.
This way that I can easily identify which parts of your C code correspond to which parts
of my Matlab code. You can even put my Matlab code comment inside your C code.