Hi I have a function that perfroms a complex mathematical algortihm. I want to modify it to take my equation rather than use the example equation. By the way this is the equation to solve, not the equation that performs the mathematics...

The function to perform the algorthm is in main here:
Code:
min=simplex(rosen,start,2,1.0e-4,1);
rosen is the function that holds the equation i want to solve, simplex is the function that will perform the maths.
The function rosen is like this:

Code:
double rosen(double x[], double Actual_Output[], double Input[])
{
    double c;
    double Fitted_Curve;
    double Error_Vector[];
    double sse;
  
  c = -1/atanh((exp(x[0]*2*pi)-cosh(x[0]*x[1]*Actual_Output))/sinh(x[0]*x[1]*Actual_Output));
  Fitted_Curve = (1/(x[0]*x[1]))*(c-asinh(sinh(c)*exp(x[0]*Input*2*pi)));
  Error_Vector=Actual_Output-Fitted_Curve ;
    return sse=sum(Error_Vector.^2);
}
My problem is passing rosen the arrays Actual_Output and Input. These are 5 by 1 vectors really, and I want the least squares error returned to the call function. I am not sure whether I have to use loops or can it do all the calculations just knowing those are vectors?

I am really a matlab user but I need to use c for this project. please can someone give me a hand.