11  Index Expressions

octave description
var(idx) select elements of a vector
var(idx1, idx2) select elements of a matrix
var([1 3], :) rows 1 and 3
var(:, [2 end]) the second and last columns
var(1:2:end,2:2:end) get odd rows and even columns
var(var2 == 0) elements of var1 corresponding to zero elements of var2
var(:) all elements as a column vector