% reading light curve produced by mkdifflc.cl

fid = fopen('lclist','r'); % open file containing list of output files from mkdifflc.cl

for i=1:8 % number of points in list

    name=fscanf(fid,'%s',1);
    fod=fopen(name,'r');
    junk=fscanf(fod,'%s',8);
    mag(i)=fscanf(fod,'%f5.2',1);
    day(i)=fscanf(fod,'%f5.2',1);
    if day(i)>100000 % i.e., this is jd instead of mjd
       day(i)=day(i)-2400000;
    end
    junk=fscanf(fod,'%s',24);
    for j=1:10
        magstar(i,j)=fscanf(fod,'%f5.2',1);
        fluxstar(i,j)=fscanf(fod,'%f5.2',1);
    end
    error(i)=std(magstar(i,:));
end

errorbar(day-53000,mag,error,'o')
set (gca, 'ydir', 'reverse')
xlabel ('MJD-53000 [day]')
ylabel ('Magnitude difference from constant artificial reference star [mag]')
 