How to fit curve based on two related independent variables ?
Hello, I met this problem when doing curve fitting with ‘fit’ function, I wish get some help.
For independent variables, I have:
x=[1 2 3 4 5 6];
y=[1 1 1 2 2 2];
The dependent variable is:
z=[10 11 12 13 14 15];
My function is written as:
z=a*(x/y+x)
a is the coefficient to be evaluated. x and y varies but related, so x and y don’t form a 2D plane. the result of ‘x/y’ in the function is actually supposed to be equivalent to ‘x./y’.
I tried designating y as problem-depedent parameter (not working, as only one value is allowed for one parameter)
I tried using ‘x./y’ in the function, but it seems ‘fit’ still reads it as a 2D surface.
Please share your opinions on this problem, I have n’t figure out the right way to do it yet. I appreciate a lot your help.
Sincerely
chenHello, I met this problem when doing curve fitting with ‘fit’ function, I wish get some help.
For independent variables, I have:
x=[1 2 3 4 5 6];
y=[1 1 1 2 2 2];
The dependent variable is:
z=[10 11 12 13 14 15];
My function is written as:
z=a*(x/y+x)
a is the coefficient to be evaluated. x and y varies but related, so x and y don’t form a 2D plane. the result of ‘x/y’ in the function is actually supposed to be equivalent to ‘x./y’.
I tried designating y as problem-depedent parameter (not working, as only one value is allowed for one parameter)
I tried using ‘x./y’ in the function, but it seems ‘fit’ still reads it as a 2D surface.
Please share your opinions on this problem, I have n’t figure out the right way to do it yet. I appreciate a lot your help.
Sincerely
chen Hello, I met this problem when doing curve fitting with ‘fit’ function, I wish get some help.
For independent variables, I have:
x=[1 2 3 4 5 6];
y=[1 1 1 2 2 2];
The dependent variable is:
z=[10 11 12 13 14 15];
My function is written as:
z=a*(x/y+x)
a is the coefficient to be evaluated. x and y varies but related, so x and y don’t form a 2D plane. the result of ‘x/y’ in the function is actually supposed to be equivalent to ‘x./y’.
I tried designating y as problem-depedent parameter (not working, as only one value is allowed for one parameter)
I tried using ‘x./y’ in the function, but it seems ‘fit’ still reads it as a 2D surface.
Please share your opinions on this problem, I have n’t figure out the right way to do it yet. I appreciate a lot your help.
Sincerely
chen fit related independent variables MATLAB Answers — New Questions