# StepRange


获取固定步长的范围值

# 语法

y = StepRange(a, n, b)

# 说明

y = StepRange(a, n, b) 获取从 a 开始到 b 结束,步长为 n 的值,最后一个值不超过 b示例

# 示例

生成 a, b 区间步长为 n 的值

创建一个区间 [1, 10] ,获取所有 1 到 10 之间步长为 Int8(2) 的值。

y1 = StepRange(1, Int8(2), 10)
1:2:9

将y1变为向量形式。

collect(y1)
5-element Vector{Int64}:
1
3
5
7
9
创建一个 StepRange

语法a:b:c,其中a、b、c都是整数,可create-a-steprange。

typeof(1:3:6)
StepRange{Int64, Int64}
typeof(StepRange(1, Int8(2), 10))
 StepRange{Int64, Int8}

# 输入参数

a, b - 区间起点和终点
整数 | 浮点数

a, b 为区间的起点和终点。StepRange(a, n, b)获取的范围一定从 a 开始,但结束值不超过 b 。

数据类型: Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Float16 | Float32 | Float64

n - 步长
整数 | 浮点数

n 为区间之内的步长值。

数据类型: Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Float16 | Float32 | Float64

# 另请参阅

LinRange | logspace | meshgrid2 | meshgrid3 | ndgrid