Writing vectors for exponetial equation

Hi, I' trying to fit my data that include 4 vectors in to this equation by using division function. However I don't know how to write D matrix. Here is my Equation.
F = a0 + a1*Em + a2*Ei*exp(a3*VF)
D = ?
U = D \ F

 Risposta accettata

Star Strider
Star Strider il 15 Mag 2018
Your model is nonlinear, not linear, so you cannot use the mldivide,\ function or operator with it. (It is nonlinear because the partial derivative with respect to the ‘a3’ parameter is a function of itself, and also ‘a2’.) You will have to use a nonlinear parameter estimation function, such as nlinfit, lsqcurvefit, or fminsearch.

4 Commenti

Thank you so much for such a quick response. I checked the functions you suggested. All of them can be used for two independent variable. However I have three independent variable. Do you think that it is possible to solve this equation. If so, would you please give me an example for 3 independent variable. I'm fairly new to matlab. Your help is much appreciated.
They all use one independent variable, and one vector of the parameters.
To use two independent variables, combine them into one (Nx2) matrix, and pass that as the independent variable.
For example, if you want to fit
z = b1 * exp(b2*x) * sin(b3*y)
combine ‘x’ and ‘y’ into a single matrix, here called ‘xy’, as:
xy = [x(:) y(:)];
and the objective function is then:
zfcn = @(b,xy) b(1) .* exp(b(2).*xy(:,1)) .* sin(b(3).*xy(:,2));
Note that here, ‘z’ would also have to be a column vector, ‘z(:)’.
That should get you started.
Thank you so much for providing this sample. I understood completely.
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Prodotti

Release

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by