Curve fit for multiple variables

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.

 采纳的回答

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 '\'

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by