%MMP_read_acm.m
%  a script to read a user-specified MMP ascii ACM file 
%  and make availabe in the work space the following variables:
% Vab Vcd Vef Vgh aHx aHy aHz aTx aTy

directory=input(' Enter the name of the directory holding the data file: ','s');
prof_num=input('    And the profile number you want to read: ');

  afile=['A',sprintf('%7.7i',prof_num)];


filename=[directory '/' afile '.TXT'];

if(exist('Vab'));
clear Vab Vcd Vef Vgh aHx aHy aHz aTx aTy;
end

if exist(filename,'file');
eval(['load ',filename]);
   acm=eval(afile);
   disp(['Loading ACM file:  ',filename]);

        asnum=[1:1:length(acm)];
        aTx=acm(:,1); 
        aTy=acm(:,2);
        aHx=acm(:,3);
	aHy=acm(:,4);
        aHz=acm(:,5); 
        Vab=acm(:,6); 
        Vcd=acm(:,7); 
        Vef=acm(:,8); 
        Vgh=acm(:,9);


else

disp(['File not found or is unaccessible ']);
    disp(['ACM file in question:  ',filename]);

end


