Learn R Programming

ffmanova (version 1.1.1)

matlabColon: Simulate Matlab's `:'

Description

A function to simulate Matlab's ‘:’ operator.

Usage

matlabColon(from, to)

Arguments

from

numeric. The start value.

to

numeric. The end value.

Value

A numeric vector, possibly empty.

Details

matlabCode(a,b) returns a:b ('s version) unless a > b, in which case it returns integer(0).

See Also

seq

Examples

Run this code
# NOT RUN {
identical(3:5, matlabColon(3, 5)) ## => TRUE
3:1 ## => 3 2 1
matlabColon(3, 1) ## => integer(0)

# }

Run the code above in your browser using DataLab