Yorick Reference Card

Web Home
Getting Started
Manual
Quick Reference
Language Reference
Function Reference
I/O Reference

Language Reference Function Reference Including Source Files Comments Issuing Shell Commands Matrix Multiplication Information About Variables Elementary Functions Advanced Array Indexing Index Range Functions Logical Functions Interpolation and Lookup Functions Sorting Transposing Manipulating Strings Generating Simple Meshes Using Pointers Instancing Data Structures Reshaping Arrays I/O Reference | # Yorick Function Reference ## Interpolation and Lookup Functions In the following function, y and x are one-dimensional arrays which determine a piecewise linear function y(x). The x must be monotonic. The xp (for x -prime) can be an array of any dimensionality; the dimensions of the result will be the same as the dimensions of xp. `digitize(xp, x)` returns indices of xp values in x `interp(y, x, xp)` returns yp, xp interpolated into y(x) `integ(y, x, xp)` returns the integrals of y(x) from x(1) to xp Note that `integ` is really an area-conserving interpolator. If the xp coincide with x, you probably want to use `(`y `(zcen)*`x `(dif))(cum)` instead. The on-line `help` documentation for `interp` describes how to use `interp` and `integ` with multidimensional y arrays.