a = [1 2; 3 4; 5 6] I want to extract the first and third row of a, so I have x = [1; 3] (indices of rows).
a = [1 2; 3 4; 5 6]
a
x = [1; 3]
a(x)
type this: a([1 3],[1 2]) the output is
a([1 3],[1 2])
ans = 1 2 5 6