matlabColon | R Documentation |
A function to simulate Matlab's ‘:’ operator.
matlabColon(from, to)
from |
numeric. The start value. |
to |
numeric. The end value. |
matlabCode(a,b)
returns a:b
('s version) unless a > b
,
in which case it returns integer(0)
.
A numeric vector, possibly empty.
Bjørn-Helge Mevik
seq
identical(3:5, matlabColon(3, 5)) ## => TRUE
3:1 ## => 3 2 1
matlabColon(3, 1) ## => integer(0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.