
104 Introduction to Computational Modeling
The other function in library basic lib is linspace, which assigns values to a
single-dimension array. This function also assigns values that are equally spaced
using the initial value, the final value, and the number of values in the vector. In the
following example, a call to function linspace assigns vector y equally-spaced values
starting with 3.15, a final value of 20.5, and a total of 20 values.
linspace(y, 3.15, 20.5, 20);
The following C source listing is the definition of function linspace; note that the
first parameter is a one-dimensional array of type double.
/
*
This function computes the num element ...