Fitting of multiple data sets with different lengths
15 次查看(过去 30 天)
显示 更早的评论
Hello all,
I want to fit several sets of data with varying lengths to a single curve. They are independent repeated sets achieved from experiment shown by the graph (The dashed and the solid lines make no difference). To address the key of my question, only 3 sets are given as following. Could you show me a thought please? Thank you all.
X1=[0 ,20 ,40 ,54.78];
Y1=[5.31,5.12,2.98 ,0 ];
X2=[0 ,20 ,40 ,60 ,69.66];
Y2=[6.29,6.15,4.90,1.68 ,0 ];
X3=[0 ,20 ,40 ,60 ,80 ,84.52];
Y3=[6.39,6.30,5.50 ,3.30,0.38 ,0 ];
0 个评论
采纳的回答
the cyclist
2018-2-21
编辑:the cyclist
2018-2-21
First, combine all the X's and Y's into a single dataset:
X = [X1, X2, ... XN]'; % Transpose to a column vector, because fitting functions expect columns
Y = [Y1, Y2, ... YN]'; % Transpose to a column vector, because fitting functions expect columns
Then, use the fitting function of your choice on X and Y. You don't say what kind of functional form you want to fit, so it is not possible to state which function you need.
If you have the Statistics and Machine Learning Toolbox, then take a look at your options on this documentation page.
2 个评论
the cyclist
2018-2-21
编辑:the cyclist
2018-2-21
Your description suggests that the fact that the data were collected from different experiments is not an important variable. I therefore assume that that distinction can be ignored, which is why you can concatenate the data (as if they were from a single experiment). You'll still need to ensure that each (X,Y) pair is properly accounted for (i.e. appears in the same row of their respective vectors).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!