%% SL 13
data = xlsread('measurement1.xlsx', 1, 'B2:D31');
plot(data(:,1), data(:,2));


%% SL 15
x = -pi:0.01:pi;
fx = cos(x) + cosh(x)/10;
xlswrite('Excel_file.xlsx', x', 1, 'A1')
xlswrite('Excel_file.xlsx', fx', 1, 'B1')

%% SL 17
clc; clear;
fid = fopen('mesh_ESA_MM1.mphtxt');
start = false;
Data  = [];
k     = 1;
while ~feof(fid)
    line  = fgetl(fid);
    if start && isempty(line)
        break
    end    
    if start
        data      = str2num(line);
        Data(k, :) = data;
        k          = k + 1;
    end
    if strcmp(line,'# Mesh point coordinates')
       start = true; 
    end
end
fclose(fid);

%% SL 19
clc;
fid = fopen('newMesh.txt', 'w');
fprintf(fid, 'Mesh points (number %3.0f)\r\n\r\n', size(Data,1));
for k = 1:size(Data, 1)
    fprintf(fid, '%3.8f %3.8f\r\n', Data(k, :));
end
fclose(fid);

%% SL 32
lastSeq   = 15;
thisTimer = timer;
thisTimer.Period        = 1/2;
thisTimer.ExecutionMode = 'fixedRate';
thisTimer.UserData      = 1;
thisTimer.TimerFcn      = {@timer_update, lastSeq};
start(thisTimer);

