% Funzione che approssima il dato alla quarta cifra decimale (decimi di
% millimetri)
function [X_IPLHR,Y_IPLHR,Z_IPLHR,Xlocal_IPLHR,Ylocal_IPLHR,Zlocal_IPLHR,HShift_IPLHR,...
    HShift_local_IPLHR,Azimuth_IPLHR,Speed_IPLHR,Speed_local_IPLHR,Acceleration_IPLHR,...
    Acceleration_local_IPLHR,TempDef_IPLHR] = approx_IPLHR(X_IPLHR,Y_IPLHR,Z_IPLHR,...
    Xlocal_IPLHR,Ylocal_IPLHR,Zlocal_IPLHR,HShift_IPLHR,HShift_local_IPLHR,Azimuth_IPLHR,...
    Speed_IPLHR,Speed_local_IPLHR,Acceleration_IPLHR,Acceleration_local_IPLHR,TempDef_IPLHR,FileName)
        
conv = X_IPLHR*1000000;
conv = round(conv);
X_IPLHR = conv/1000000;

conv = Y_IPLHR*1000000;
conv = round(conv);
Y_IPLHR = conv/1000000;

conv = Z_IPLHR*1000000;
conv = round(conv);
Z_IPLHR = conv/1000000;

conv = Xlocal_IPLHR*1000000;
conv = round(conv);
Xlocal_IPLHR = conv/1000000;

conv = Ylocal_IPLHR*1000000;
conv = round(conv);
Ylocal_IPLHR = conv/1000000;

conv = Zlocal_IPLHR*1000000;
conv = round(conv);
Zlocal_IPLHR = conv/1000000;

conv = HShift_IPLHR*1000000;
conv = round(conv);
HShift_IPLHR = conv/1000000;

conv = HShift_local_IPLHR*1000000;
conv = round(conv);
HShift_local_IPLHR = conv/1000000;

conv = Azimuth_IPLHR*10;
conv = round(conv);
Azimuth_IPLHR = conv/10;

conv = Acceleration_local_IPLHR*1000000;
conv = round(conv);
Acceleration_local_IPLHR = conv/1000000;

conv = Speed_IPLHR*1000000;
conv = round(conv);
Speed_IPLHR = conv/1000000;

conv = Speed_local_IPLHR*1000000;
conv = round(conv);
Speed_local_IPLHR = conv/1000000;

conv = Acceleration_IPLHR*1000000;
conv = round(conv);
Acceleration_IPLHR = conv/1000000;

conv = TempDef_IPLHR*10;
conv = round(conv);
TempDef_IPLHR = conv/10;

text = 'approx_TLHR function executed correctly';
fileID = fopen(FileName,'a');
fmt = '%s \r';
fprintf(fileID,fmt,text);
fclose(fileID);

end