fitting a function with 3 parameter

4 ビュー (過去 30 日間)
shayan afifeh
shayan afifeh 2019 年 4 月 7 日
回答済み: Bjorn Gustavsson 2019 年 4 月 7 日
Hello everyone;
I have some data include x,y,z,t.
how can I fitting this data on this Equation: t= a*x+b*y+c*z
i need a,b,c .

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2019 年 4 月 7 日
This is a simple linear fitting problem, you solve it this way:
M = [x(:),y(:),z(:)]; % creating a matrix of all your independent parameters giving you a
% vector-matrix-versio of your equation:
% t = M*abc(:);
abc = M\t;
You can generalize this for arbitrary fitting-functions, just expand M with columns for x^2, sin(w*y) and the like. Matlab has all sort of fitting functions more general and agile. Have a look at polyfit, lscov and others
HTH

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by