function []=Axis3d(x,y,z)
if nargin==0
g=gcf;
a=g.CurrentAxes;
xLim=a.XLim;
yLim=a.YLim;
zLim=[-1,1];
else
x1=min(x)
x2=max(x)
y1=min(y)
y2=max(y)
z1=min(z)
z2=max(z)
xLim=[x1,x2];
yLim=[y1,y2];
zLim=[z1,z2];
end
hold on
plot3(xLim,[0, 0],[0, 0],'-k')
hold on
plot3([0, 0],yLim,[0, 0],'-k')
hold on
plot3([0, 0],[0, 0],zLim,'-k')
or call this function Axis3d