python中类似matlab有等间隔采样的函数
numpy模块中的linspace
官方文档说明:
numpy.
linspace
(
start,
stop,
num=50,
endpoint=True,
retstep=False,
dtype=None
)//调用方式Return evenly spaced numbers over a specified interval.
Returns num evenly spaced samples, calculated over the interval [start, stop].
The endpoint of the interval can optionally be excluded.
Parameters: | start : scalar //采样起始数值
stop : scalar //终止数值
num : int, optional //采样个数
endpoint : bool, optional //endpoint为bool值,True则终止点为在stop中设置的数值
retstep : bool, optional //位bool值,restep为true则返回实际采样间隔
dtype : dtype, optional //数值类型,缺省状态下默认为输入数值类型
|
---|---|
Returns: | samples : ndarray
step : float, optional
|
Examples