Dear Doug,
Thanks very much for your replay. Please, could you send me the solution?
OK.
You are trying to fit 2 straight lines to a set of data. Straight lines are of the form y = a*x+b. You did not have the b.
first I wrote a M file function that calculated a least-square value and returned this value.
The input to this function has to be the unknowns your R and the 2 'b's.
Then I wrote the calling function and used the fminsearch function like this:
w=fminsearch (@q1,[R;b1;b2])
w is the resulting values for R b1 b2
Fminsearch takes the starting values for R b1 b2 and adjusts them to minimize the value returned from q1.m
I then used the calculated values and calculated a resultant y3 values and then plotted them together.
If you have more questions I will try and answer them.
Let me know If this works for you.
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html