vq = interp1(x, v, xq)
vq = interp1(x, v, xq, 'linear')
vq = interp1(v, xq)
vq = interp1(v, xq, 'linear')
| Parameter | Description |
|---|---|
| x | Sample points: vector. |
| v | Sample values: vector, matrix. |
| xq | Query points: scalar, vector, matrix. |
| Parameter | Description |
|---|---|
| vq | Interpolated values: scalar, vector, matrix. |
vq = interp1(x, v, xq) returns interpolated values of a 1-D function at specific query points using linear interpolation.
f = figure();
v = [0 1.41 2 1.41 0 -1.41 -2 -1.41 0];
xq = 1.5:8.5;
vq = interp1(v,xq);
plot(1:9, v, 'o', xq, vq, '*');
legend('v','vq');
| Version | Description |
|---|---|
| 1.0.0 | initial version |