I want to fit some data with MATLAB but my fit-function is pretty large and I just want to put it into pieces of functions.
At first I just tried it like
p1_prime = @(x,p) ...
p2_prime = @(x,p) ...
Then I put it into my model function
mod = D*exp(-p1_prime) + D*(-p2_prime)
Is there a simple way to do this?