Contents Previous Next Subchapters

Create a Grid With Evenly Spaced Logarithms
Syntax logspace(lowerupper)
logspace(loweruppernpoint)
See Also linspace

Description
Returns a double-precision row vector of int(npoint) points that have their logarithms equally spaced. The first point in the grid is 10^lower. If upper is equal to PI , the last point in the grid is pi. Otherwise, the last point in the grid is 10^upper. The arguments lower, upper, and npoint, are all integer, real, or double-precision scalars. If the argument npoint is not present, the value 50 is used in its place.

Example
If you enter
     ginit
     x = logspace(-1, +1)
     plot(x, 1d0 / x)
     gyaxis("log")
O-Matrix will draw the following plot

Reference
Note that the return value of logspace is a row vector. So, for example, to make the plot above using gplot you would enter
     ginit
     x = logspace(-1, +1)'
     gplot(x, 1d0 / x)
     gyaxis("log")
(Note the ' in this example that is not in the example above.)