function arrow3(v,varargin)
%   arrow3(v)
%   arrow3(x,v)
%   arrow3(v,specs)
%   arrow3(x,v,specs)
% 
% draw 3D arrow for vector v 
%   v: vector of length 3
%   x: starting point (vector of length 3), default is [0;0;0]
%   specs: specifies style, LineSpec such as 'r:' (see help for plot)
%                           and/or name,value arguments such as 'LineWidth',3
% Examples:
%   arrow3([2;3;1])         % draw vector [2;3;1]: arrow from (0,0,0) to (2,3,1)
%   arrow3([1;1;1],[2;3;1]) % draw vector [2;3;1] starting at (1,1,1): arrow from (1,1,1) to (3,4,2)
%   arrow3([2;3;1],'r')     % draw red arrow
%   arrow3([2;3;1],'g','LineWidth',3)  % draw green arrow with linewidth 3

x = [0;0;0];
k = 1;
if nargin>=2 && ~ischar(varargin{1})
  x = v;
  v = varargin{1};
  k = 2;
end
x = double(x);
v = double(v);

quiver3(x(1),x(2),x(3),v(1),v(2),v(3),0,varargin{k:end});



