Toolbox: lib/misc

Miscellaneous routines for the library. Some of these routines might move to other subdirectories in the future.

Interpolation, integration, differentiation, extremes, roots

The following table summarizes the supporting functions.
general data periodic data
first order cubic Fourier
task spline spline series
parametrisation - knot, knot_p get_fourier
interpolation spline1 spline, spline_p fnfourier
differentiation spline1 spline, spline_p dfnfourier
2nd differentiation zero spline, spline_p ddfnfourier
integration ispline1 ispline ifnfourier
roots rspline1 rspline rfnfourier
extremes espline1 espline efnfourier
example script mydata_smooth mydata_smooth mydata_smooth


The function wrap wraps a vector into a matrix, like function reshape, but the number of elements doesn't need to match. Function trian wraps a vector into an upper trangular matrix, function itrian does the inverse.

Function select_marker modifies the specification of a marker that can be used in plotting.

Function v2struct converts variables into a structure, function vars_pull does the opposite. Function comp_struct checks two structures for differences. Function matrix2file writes a matrix of numbers to an m-file.


Function beta0 computes a special incomplete beta function; function gamma the incomplete gamma function.

Functions re and im separate the real and imaginary parts of complex numbers.

Function ricatti solves the Riccati equation. Function rotate rotates a 2-vector.

Functions roots3 and rooth find roots of a cubic polynomial. Function cont1 finds intervals for which a function exceeds a specief level.

Functions dirfield and dirfield3 compute the direction fields for 2 and 3 variables.


Function rkutta intergrates a set of ode's using a Runge Kutta 5 method; int2equi integrates till equilibrium. Function numdif numerically differentiates a function of several variables. Function nmmin finds the minimum of a function.

Function cummax gets cumulative maxima from a series of numbers.


Function C2K converts Celsius to Kelvin, K2C does the opposite. tempcorr computes the temperature correction factor, shtemp2corr produces a plot of the correction factor as function of temperature.

Functions shstar and shloglogstar plot a star where slopes are multiples of 1/3.

Functions printpar and print_txt_var print text in combination with values.


Function debtool_fn_markup specifies the markup rules for function in DEBtool_M. It can be used as template to write DEBtool functions.
Back to the DEBtool page