%% read_spectrum
% reads the spectrum and its label from datastore ds 

function [spec, label] = read_spectrum(ds, indx)
    spec = readtable(ds.Files{indx}, ...
                     "VariableNamingRule", "modify");
    label = ds.Labels(indx);
end