combinations, nchoosek or similar function nx2 array

1 view (last 30 days)
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 Comment
Matt Tearle
Matt Tearle on 12 Jan 2012
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?

Sign in to comment.

Answers (0)

Categories

Find more on Curve Fitting Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!