MATLAB: Dividing a vector elements into n parts

findpeaksMATLAB

I have 'y' values which make up y-axis and 'x' values which makeup x-axis. x>y, and I can't manipulate the points in the graph so I want 1 value of 'y' for each 'x' so that I can manipulate the value of 'y' at that specific 'x'. How can I do it?
x and y are different vectors ('y' is not sorted) I have current points of 'x' with corresponding 'y'

Best Answer

Use interp1,
desiredY = interp1(currentX,currentY,desiredX)
Related Question