matlab-linspace/logspace

2015-04-16  本文已影响56人  六便士少年

linspace

Generate linearly spaced vectors
Syntax
y = linspace(a,b)
y = linspace(a,b,n)
Description
The linspace function generates linearly spaced vectors. It is similar to the colon operator ":", but gives direct control over the number of points.
y = linspace(a,b) generates a row vector y of 100 points linearly spaced between and including a and b.
y = linspace(a,b,n) generates a row vector y of n points linearly spaced between and including a and b.

logspace

Generate logarithmically spaced vectors
Syntax
y = logspace(a,b)
y = logspace(a,b,n)
y = logspace(a,pi)
Description
The logspace function generates logarithmically spaced vectors. Especially useful for creating frequency vectors, it is a logarithmic equivalent of linspace and the ":" or colon operator.

y = logspace(a,b)

y = logspace(a,b,n)

y = logspace(a,pi)

上一篇 下一篇

猜你喜欢

热点阅读