figure(nfig+2)
subplot(221)
plot(t,ndat,'r-x',t,nmod,'b-o'),axis([tt0,tt1,.5,.7])
title('OUTPUTS: Fraction employed')
legend('Data=Red','Model=Blue')
subplot(222)
plot(t,hdat,'r-x',t,hmod,'b-o'),axis([tt0,tt1,.5,.6,])
title('Hours per worker')

fid      = fopen('tecplot2.dat','w');
vars     = [' n';
            ' h'];
nhist    = 10;
fprintf(fid,['variables= t ',vars(1,:),' p1 ']);
fprintf(fid,[vars(2,:),' p2 ']);
fprintf(fid,' \n');
fprintf(fid,'zone i=6 j=%3g f=block\n',nhist);
for j=1:2;
  tem = zeros(nhist*6,3);
  eval(['var       = ',vars(j,:),';']); 
  for i=1:6;
     [freq,vals]      = hist(var(i,:),nhist);
     freq             = freq/sum(freq);
     tem(i:6:6*nhist,:)  = [(1940+i)*ones(nhist,1),vals',freq'];
  end; 
  if j==1;
    for i=1:nhist;
      fprintf(fid,' %8g%8g%8g%8g%8g%8g\n',tem((i-1)*6+1:i*6,1));
    end;
  end;
  for i=1:nhist;
    fprintf(fid,' %8.5f%8.5f%8.5f%8.5f%8.5f%8.5f\n',tem((i-1)*6+1:i*6,2));
  end;
  for i=1:nhist;
    fprintf(fid,' %8.5f%8.5f%8.5f%8.5f%8.5f%8.5f\n',tem((i-1)*6+1:i*6,3)); 
  end;
end;
fclose(fid);
