x = 0:500 ;
y=100*sin(2*pi*3*x/500) ;

filename = "data.txt";
fid = fopen (filename, "w");
fprintf (fid, "%d \n", length(x));
for i=1:length(x)
fprintf (fid, "%d  %6.3f \n", 50+x(i), 250+y(i));
end
fclose (fid);

