Creating arrays
Two arrays can be combined with a comma and brackets:
x = [1 2 3];
y = [4 5 6];
[x, y] (is [1 2 3 4 5 6])
z = [x, [x, y]];
The colon can be used to generate a sequence of values. Forms:
lowValue : highValue
lowValue : step : highValue
Previous slide
Next slide
Back to first slide
View graphic version