MATLAB: Simple vector question.

vector

If there is a vector C,
C = [3 8 9 7 3]
how can I make another vector that displays its position?
eg. D = [1 2 3 4 5]
eg2. E = [6 10 9 11 3 9 31 41]
F = [1 2 3 4 5 6 7 8]
eg3. Y = [7 5 3 1 8 6]
Z = [1 2 3 4 5 6]

Best Answer

Try
D = 1 : length(C);
Similarly for the other letter-named vectors.