colon

colon operator ':'.

Syntax

  • R = colon(base, limit)

  • R = colon(base, increment, limit

Input argument

  • base - a variable

  • limit - a variable

  • increment - a variable (optional)

Output argument

  • C - result

Description

colon creates vectors. It is an usefull function for loop, extraction and insertion.

colon(base, limit) is equivalent to base:limit

colon(base, increment, limit) is equivalent to base:increment:limit

Examples

1:0.5:4
A = 1:6
B = 1:4:12
C = rand(3, 4)
C(:)
C(:, 3)
C(2, :)
C(:, 1, 1)
C(:) = rand(3, 4)

History

VersionDescription

1.0.0

initial version

Author

Allan CORNET

Last updated