powered by
A function to simulate Matlab's ‘:’ operator.
matlabColon(from, to)
numeric. The start value.
numeric. The end value.
A numeric vector, possibly empty.
matlabCode(a,b) returns a:b ('s version) unless a > b, in which case it returns integer(0).
matlabCode(a,b)
a:b
a > b
integer(0)
seq
# 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