// to do binary search.. function[]=search(a) i=1; [j,k]=size(a); for i=1:k if x==a(i) then printf("\nFOUND and index no. is=%d\t",i); end end funcprot(0); endfunction //callin routine a=[5 7 45 28 99] x=45 binary=search(a)