function [inputdata, targets] = load_data(directory,dataset)

% Code provided by Computational Cognitive Neuroscience Lab
% University of Padova
% ccnl.psy.unipd.it

inputdata=[];
targets=[];
temp=[];

path=strcat(directory,dataset);
load ('-mat',path);
[r,c]=size(Data);
[nr,nc]=size(Data{1,1});
for j=1:c
    for i=1:r
        for k=1:nr
            temp = [temp,Data{i,j}(k,1:end)];
        end
        input(i,:)=temp;
        temp=[];
    end
    tt=zeros(1,c);
    tt(j)=1;
    ttemp=repmat(tt,r, 1);
    inputdata=[inputdata;input];
    targets=[targets;ttemp];
    input=[];
end

end