function checkvector(a,errormessage)
% checkvector(a,errormessage)
% checks if the input is a vector (nx1 or 1xn)
% no output, error stop if it is not.

if length(size(a))==2
   if size(a,1)~=1 & size(a,2)~=1
      error(errormessage)
   end
else
  error(errormessage)
end
