% sends all msg files received from the float to rd_msg.m for processing

% requires:
  % msg files
  % rd_msg.m

% saves apex_msg

% written by E. Boss, UMaine, 2004
% email: emmanuel.boss@maine.edu

close all
clear all

[file_list_out,n_file_out]=list_file('C:\Documents and Settings\Lisa Taylor\My Documents\Data\Argos\0005\data')
  for ii = 1:n_file_out-3
      filename=file_list_out(ii+3,:);
      filename1=['C:\Documents and Settings\Lisa Taylor\My Documents\Data\Argos\0005\data\',filename];
      [C, D, E, F, G, H]=rd_msg(filename1); 
      file_i=int2str(ii);
       n=length(file_i);
        if n==1
           assignin('base',['date00',int2str(ii)],C);
           assignin('base',['date200',int2str(ii)],D);
           assignin('base',['stat00',int2str(ii)],E);
           assignin('base',['lat00',int2str(ii)],F);
           assignin('base',['lon00',int2str(ii)],G);
           assignin('base',['dat00',int2str(ii)],H);
        elseif n==2
           assignin('base',['date0',int2str(ii)],C);
           assignin('base',['date20',int2str(ii)],D);
           assignin('base',['stat0',int2str(ii)],E);
           assignin('base',['lat0',int2str(ii)],F);
           assignin('base',['lon0',int2str(ii)],G);
           assignin('base',['dat0',int2str(ii)],H);
        else 
           assignin('base',['date',int2str(ii)],C);
           assignin('base',['date2',int2str(ii)],D);
           assignin('base',['stat',int2str(ii)],E);
           assignin('base',['lat',int2str(ii)],F);
           assignin('base',['lon',int2str(ii)],G);
           assignin('base',['dat',int2str(ii)],H);
        end           
  end

N=(n_file_out-3);
save apex_msg -v6
