We will use the following data:
x = 1:5:50;
y = randi([-10 10],1,10);
Hereby x and y are the coordinates of the data points and z are the points we need information about.
z = 0:0.25:50;
One way to find the y-values of z is piecewise linear interpolation.
z_y = interp1(x,y,z,'linear');
...