clear; clc;
format short;
format compact;
close all;
rng('default');
measurementLength = 100;
measurementDays = 50;
sz = [measurementDays,3];
varTypes = {'datetime','cell','categorical'};
varNames = {'date','data','faultCode'};
sampleData = table('Size',sz,'VariableTypes',varTypes,'VariableNames',varNames);
dateval = datetime('now','Format','yyyy/MM/dd');
A = randi(3,measurementDays,1);
faultCode = categorical(A,[1,2,3],{'x','y','z'});
for day = 1:measurementDays
var1 = rand(measurementLength,1);
var2 = rand(measurementLength,1);
measurementTime = seconds(1:measurementLength);
measurementTime = measurementTime(:);
tt = timetable(measurementTime, var1, var2);
dateval = dateval+days(day-1);
sampleData.date(day) = dateval;
sampleData.data(day) = {tt};
sampleData.faultCode(day) = faultCode(day);
end