mode(0)

//Question 2
v=1:100;
s1=v*v'
s2=sum(v.^2)
s3=sum(1./v)


//Question 4
t=0:1000;
x=t/100;
y=sin(x);
plot2d(x,y,style=2)
z=cos(x);
plot2d(x,z,style=5)
clf()
plot2d(y,z)

//Question 5
u=10
for i=1:6
  u=u-(u*u-2)/2/u
end
u-sqrt(2) 

s=0
for i=1:100
  s=s+i^2;
end
s

F=[1,1];
for i=3:100
  F(i)=F(i-1)+F(i-2);
end
F(100)

V=[5/2,13/5]
for n=1:278
  V(n+2)=1+(14*V(n)-24)/V(n)/V(n+1);
end

//Question 6
x=[0:1000]/100;
u=x([1:$-1]);
v=(sin(u+0.01)-sin(u))/0.01;
clf()
plot2d(u,v)
plot2d(u,cos(u),style=5)
