clear;
a=randperm(1000000);
target=201311;
b=[a,target];
k=1;tic;
while (b(k)~=target)
    k=k+1;
end;time1=toc;
if (k==length(a))
    disp(['Could not find ',num2str(target)]);
else
    disp([num2str(target),' is ',num2str(k),'th element']);
end
disp(['The calculation needs ',num2str(time1),'second']);
tic;
pos=find(b==target);
time2=toc;
if (isempty(pos))
    disp(['Could not find ',num2str(target)]);
else
    disp([num2str(target),' is ',num2str(k),'th element']);
end
disp(['The calculation needs ',num2str(time2),'second']);
