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!