function ppi=ttry(n) pointx=-1+2*rand(1,n); pointy=-1+2*rand(1,n); index=pointx.*pointx+pointy.*pointy indexx=index<=1; ppi=4*sum(indexx)/n end