combinations, nchoosek or similar function nx2 array

1 次查看(过去 30 天)
I have data points (x and y) that I am using to fit a curve. I need to find out which 4 give me the best fit.
So I need a way to represent the 'x y' pair together or find a function that can give me combinations of each row.
At the moment I get every combinations of x values and then re-pair then with the y values after, very inefficient
  1 个评论
Matt Tearle
Matt Tearle 2012-1-12
I'm having a hard time interpreting the question. "... which 4 give me the best fit" -- which 4 what? (x,y) pairs? Are you fitting a curve to four points, so you want to take every 4-point combination from the n data points that you have? Can you provide a simple example? You have x and y in what form? n-element vectors? So something like
x y
0 0
1 1
2 4
3 9
4 16
5 25
6 36
So now what are you looking for from this?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by