function fib = fibonaccivector(N)
% Storing the first N terms of the Fibonacci sequence in the components of
% a \emph{column vector}.
% Example for successively increasing the size of column vectors

% Initialize the first two terms and take care of the special case $N=1$
if (N==1), fib = [1]; else fib = [1;1]; end
for i=3:N % a loop in MATLAB; if $N<2$, then the loop body is skipped
   fib = [fib;fib(i-1)+fib(i-2)]; % \emph{Grow} vector
end
% Return value is stored in \textbf{fib}, because this is the return
% variable specified in the function header!

