0

I need to know the opposite of binning (something like over sampling),

I have less number of points on the x axis. And the curves are not very smooth when plotted against values of Yaxis. I want to find more points within lets say 2 x axis values (multiple points between 1 and 2 e.g. 1.1, 1.2, 1.3) and then interpolating between(1.1, 1.2, 1.3.....2) instead of just plotting at 1 and 2) them so that the curve looks smooth and not abrupt changes. (for e.g. between 1 and 2 in this case)

In short: I need the opposite of this.

What can I use to do this?

Community
  • 1
  • 1
  • 1
    sounds like interpolation: http://www.mathworks.co.uk/help/matlab/interpolation-1.html – QED Aug 09 '14 at 16:35

1 Answers1

0

You may interpolate your data. If linear interpolate is suitable for you, try this:

x = [1 2];
y = 2 * x;   % y is your function related to x
new_x = x(1) : 0.1 : x(end);
new_y = interp1(x, y, new_x);

You can choose another alternative interpolation methods such as 'nearest', 'linear','spline','pchip', or 'cubic'. The default method is 'linear'.