%  @param directory to data
%  @return The name of input Pad
%  @return The value
%  @return The timestamp
function [FrameRatePad, FrameRateTime, FrameRateTimestamp] = LoadFrameRate(dirpath)
    

    filename = fullfile(dirpath, "framerate_element_name_list.csv");
    opts = delimitedTextImportOptions();
    opts.Delimiter = [" ", ","];
    file = readmatrix(filename,opts);   

    elementCount = str2double(cell2mat(file(5,3)));
    cell={};
    for i = 1:elementCount
        I=i-1;
        cell(end+1) = (file(10+(5*I), 1));
    end    
    FrameRatePad = string(cell);
    clear file, opts, cell ;


    filename = fullfile(dirpath, "framerate_fps_mat.csv");
    opts = delimitedTextImportOptions();
    opts.Delimiter = [" ", ","];
    file = readmatrix(filename,opts);

    arrayY = str2double(cell2mat(file(4,3)));
    arrayX = str2double(cell2mat(file(5,3)));

    FrameRateTime = [];
    row = [];
    for y = 1:arrayY
        Y=y-1;
        for x = 1:arrayX
            X=x-1;
            row(end+1) = str2double(cell2mat(file(6+Y, 2+X)));
        end
        FrameRateTime(end+1,:) = row;
        row = [];
    end 
    clear file, opts, row; 


    filename = fullfile(dirpath, "framerate_timestamp_mat.csv");
    opts = delimitedTextImportOptions();
    opts.Delimiter = [" ", ","];
    file = readmatrix(filename,opts);

    arrayY = str2double(cell2mat(file(4,3)));
    arrayX = str2double(cell2mat(file(5,3)));

    FrameRateTimestamp = [];
    row = [];
    for y = 1:arrayY
        Y=y-1;
        for x = 1:arrayX
            X=x-1;
            row(end+1) = str2double(cell2mat(file(6+Y, 2+X)));
        end
        FrameRateTimestamp(end+1,:) = row;
        row = [];
    end 
    clear file, opts, row ;
end
