vector - Return arbitrary points on a curve in Matlab -


suppose have series of points, x-axis coordinate values stored in vector xx , y-axis values stored in vector yy. can plot curve plot(xx,yy).

now have vector xxx, elements in xxx may not in vector xx. if use xxx x-axis values, how y values corresponding xxx?

as suggested robertstettler can interpolate y values corresponding x values in xxx. matlab can offer several interpolation methods using interp1, example, linear interpolation:

yyy = interp1( xx, yy, xxx, 'linear' ); 

Comments