I have an equation of form y=a*(x1^b)*(x2^c)*(x3^d)*(x4^e)
where x1, x2, x3, x4 are variables and y is output. I have all these values experimentally.
I need to fit this equation to calculate optimum values of a, b, c, d and e.
Please provide a suitable matlab code.

 Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 2 Déc 2014
Modifié(e) : Andrei Bobrov le 2 Déc 2014

0 votes

x = [x1(:) x2(:) x3(:) x4(:)];
abcde = [ones(numel(y),1),log(x)]\log(y);
abcde(1) = exp(abcde(1));
your function
yourfun = @(x,a)a(1)*prod(bsxfun(@power,x,reshape(a(2:end),1,[])),2);
Please read about use '\'

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by