function vr = reverse(v)
%
% vr = reverse(v)
% Reverse a vector or 1D cell array.

n = length(v);

if iscell(v)
  vr = cells(1,n);
  for i=1:n
   vr{i} = v{n-i+1};
  end
else
  assert(isvector(v));
  vr = zeros(size(v));
  for i=1:n
    vr(i) = v(n-i+1);
  end
end
