% MATLAB script: accessing vector components
v = fibonaccivector(10),
% Note: line ending with a comma makes MATLAB print result

% Length of vector
N = length(v),

% Simple access by ()-operator
k = 7; vk = v(7),
% Subvector access by feeding integer vector or range into ()-operator
subvec = v([1;7;8]), % access components 1, 7, and 8
evenfib = v(2:2:10), % access components from 2 to 10 with stride 2
lastfib = v(N-3:N),  % access last \emph{four} components
altlastfib = v(end-3:end), % another way the access the last four components
flipfib = v(end:-1:1), % revert order of vector components