Fitting with dependent variable in model expr

5 views (last 30 days)
Niko
Niko on 24 Feb 2011
When trying to combine data taken in two independent experiments, I ran across the following problem when fitting:
z(P) = w(z)*f(P)
w(z) is known in the form of a cfit object, z is the dependent and P the independent from a set of data.
My first thoughts were to invert the function to obtain P(z) rather than z(P) and then to use eval in the model, but I can't figure out the proper way to formulate the fittype model to allow for this sort of behavior.
Does anybody know how to do this? I need a few pointers :)

Answers (1)

Niko
Niko on 24 Feb 2011
I solved the first problem by inverting my data, and fitting an inverted function of the form
P(z) = f^-1(z) * g(w(z))
with f,g being the appropriate functions for this transformation. The remaining question is how to do this in matlab:
Fittype with expr (w is a cfit object)
'z/feval(w,z)'
or
'z/w(z)'
throws an error:
is not a valid MATLAB expression,
has non-scalar coefficients, or cannot be evaluated

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!