% Funzione che approssima il dato alla quarta cifra decimale (decimi di
% millimetri)
function [Y_TLHRH,Z_TLHRH,Ylocal_TLHRH,Zlocal_TLHRH,speed_TLHRH,speed_local_TLHRH,...
    acceleration_TLHRH,acceleration_local_TLHRH,TempDef_TLHRH] = approx_TLHRH(...
    Y_TLHRH,Z_TLHRH,Ylocal_TLHRH,Zlocal_TLHRH,speed_TLHRH,speed_local_TLHRH,...
    acceleration_TLHRH,acceleration_local_TLHRH,TempDef_TLHRH,FileName)

% Y
conv = Y_TLHRH*10000;
conv = round(conv);
Y_TLHRH = conv/10000;

% Y local
conv = Ylocal_TLHRH*10000;
conv = round(conv);
Ylocal_TLHRH = conv/10000;

% Z
conv = Z_TLHRH*10000;
conv = round(conv);
Z_TLHRH = conv/10000;

% Z local
conv = Zlocal_TLHRH*10000;
conv = round(conv);
Zlocal_TLHRH = conv/10000;

% Velocità
conv = speed_TLHRH*10000;
conv = round(conv);
speed_TLHRH = conv/10000;

% Velocità locale
conv = speed_local_TLHRH*10000;
conv = round(conv);
speed_local_TLHRH = conv/10000;

% Accelerazione
conv = acceleration_TLHRH*10000;
conv = round(conv);
acceleration_TLHRH = conv/10000;

% Accelerazione locale
conv = acceleration_local_TLHRH*10000;
conv = round(conv);
acceleration_local_TLHRH = conv/10000;

% TempDef
conv = TempDef_TLHRH*10;
conv = round(conv);
TempDef_TLHRH = conv/10;

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

end