Polynomial fitting with multiple variables and unequal matrix length
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, Good day. Thanks in advance. I'm having problem with investigating relationship with some data. Say, A=1,2,3.. and for each A, there are 20 values of B and C correspond to B (I mean C depends on B). I can easily find a polynomial relationship between B and C but how can I create relationship between A, B and C? Please note that, I'm actually a new in Matlab, thus don't take it otherwise if the question seems somehow not appropriate.
In simple:
A=[1 2 3 4 5].
For A=1, B=[... ... ... 20 values] and C=[... ... ... 20 values]
For A=2, B=[... ... ... 20 values] and C=[... ... ... 20 values]
....
For A=5, B=[... ... ... 20 values] and C=[... ... ... 20 values].
Need to have a relationship between A, B and C.
Thanks again.
0 件のコメント
回答 (1 件)
Iain
2014 年 8 月 21 日
It kinda depeneds how those variables interact.
A "simple" method is to use the polyfit function to get a suitable relationship, for each value of A, for B to relate to C. (Quadratic/cubic/whatever).
So you get, for A = 1, C = d + eB + fB^2-hB^4 (or whatever)
Then you have 5 "A" values, 5 d values, on which you can do the same again...
To get something like d = A/4 + 0.1; e = A^2/20
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!