Contents Previous Next Subchapters

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

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.

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

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