function ukaz_vektor(v)
%   nakresli 2D nebo 3D vektor coby usecku

M=max(abs(v));
if length(v)==2
    plot([0,v(1)],[0,v(2)]);
    axis([-M-1 M+1 -M-1 M+1]);
    hold on
    plot([-M,M],[0,0],'k--');
    plot([0,0],[-M M],'k--');
elseif length(v)==3
    plot3([0,v(1)],[0,v(2)],[0,v(3)]);
    axis([-M-1 M+1 -M-1 M+1 -M-1 M+1]);
    hold on
    plot3([-M,M],[0,0],[0,0],'k--');
    plot3([0,0],[-M M],[0,0],'k--');
    plot3([0,0],[0,0],[-M M],'k--');
else 
    error('Vstupni vektor ma nespravnou delku')
end
grid on
hold off
end

