clear all;clf;
limits = [-3.3826   3.3826  -1.9732   1.9732  -1.2   1.2];
limits = [min([limits(1)]), max([limits(2)]) ,min([limits(3)]), max([limits(4)]) ,min([limits(5)]), max([limits(6)])];
Nr=1:980;

set (gcf, 'menubar', 'none',"position", [100, 100, 640, 480]);

axis ("equal",1.001*limits);
view(3);
axis (limits);
xlabel("x");ylabel("y");zlabel("z");

f2=fopen("c1.bin","rb+");coord=fread(f2,[131911,3],"double");fclose(f2);
f2=fopen("c2.bin","rb+");coordnum=fread(f2,[981,1],"double");fclose(f2);

invs=@(n) line("xdata",coord(coordnum(n):coordnum(n+1),1), ...
"ydata",coord(coordnum(n):coordnum(n+1),2), ...
"zdata",coord(coordnum(n):coordnum(n+1),3),"color", "b", "marker", "none","visible", "off");
#{
tic();
hl=arrayfun(invs, Nr);
printf("make lines invisible %es\n", toc);
#}

tic();
hl=pararrayfun(nproc,invs, Nr);
printf("make lines parallel invisible %es\n", toc);
#}
set (hl(Nr), "visible", "off");
tic();
for n=Nr
pause(0);
set (hl(n), "visible", "on");
endfor
printf("invisiblity with loop %es\n", toc);