function spirala3D
while(1)
k=input('Zadej konec intervalu: ');
if((k<-500)||(k>500))
    disp('Chyba v zadani')
    continue;
else
    disp('OK')
    break;
end % konec if
end % konec while    
t=linspace(0,k,1000);
x=t;
y=t.*sin(t);
z=t.*cos(t);
plot3(x,y,z,'r-.o')
xlabel('x')
ylabel('y')
zlabel('z')
grid
title('spirala')

end % konec funkce

