function runcar(tow);
% runcar(cast); Ledwell; 9/9/05
% processes carousel data to update the matrices in cex.mat, and
% plots the GC standard curve on the screen.
% Calls profiles.m to do the actual calculations.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finds standard numbers for tow number 'tow' from:
%	 c:\ledwell\anal\Std_nums.txt
% reads in blank area and error from:
%	 c:\ledwell\anal\blank.txt
%
% runs 'profiles' for the given tow
% adds tow number, tow number, column integral to
%   existing matrix: c:\ledwell\anal\col_int.mat
% adds C,E,to exising data matrices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% standards:

load std_nums.txt
ik = find(~isnan(std_nums(tow,2:16)));
k = std_nums(tow,ik+1);

[x,C,E,A,h]=transect(tow,k);

  load cex.mat			% load file containing current matrices of
				        % C,E,x
  cmat(:,tow) = C;
  emat(:,tow) = E;
  xmat(:,tow) = x;
  amat(:,tow) = A;
  pmat(:,tow) = h;

  save cex cmat emat xmat amat pmat
  % end
  
 figure(3)
 i=find(~isnan(C));
 bar(x(i),C(i))
 axis([0 50 0 500])
 xlabel('Position No.')
 ylabel('C  (fM)')
 
 text(5,800,['Tow ',int2str(tow)])
 
 
  
