function [Matrix,DJ,DJfilnavn,fileNames,AntalDJs] = getFeature(feature,dataset)

% henter features ud som Matrix i matlab fra Webdaven.

clear Matrix
clear fileNames
clear DJfilnavn
clear DJ2
clear DJ1
clear DJ3
clear DJ
clear AntalDJs

if dataset == 1 
    DJfilnavn = {'2_Unlimited';'Major_Lazer';'Portishead';'Adele';'Mark_Ronson';'Radiohead';'Bob_Marley';'Michael_Jackson';'Stravinsky';'Daft_Punk';'Miles_Davis';'System_of_a_Down';'Ipelegeng';'Nirvana';'White_Noise';'JayZ_KanyeWest';'Ockeghem';'Madonna';'Pharrell_Williams'};
    mappe = 'djset2';
    s5 = '_interval=[0s,900s]_noMD5.csv';

elseif dataset == 2
    DJfilnavn = {'Carl_Cox';'Seth_Troxler';'Snake';'Armin_van_Buuren_-_Main';'Hardwell';'David_Guetta';'Alesso';'Tommy_TrashLang';'Adam_Beyer_-_Ida_Engberg';'Boys_Noise'};
    mappe = 'djset'
    s5 = '_interval=[600s,1200s]_noMD5.csv';
    
elseif dataset == 3 
    %DJfilnavn = {'3LAU';'AAA3_Are_Legend';'Above_and_Beyond';'Adam_Beyer_-_Ida_Engberg';'Adrian_Hour';'Afrojack';'Agoria';'Alesso';'Andhim_-_Live';'Andrew_Bayer';'Andrew_Rayel';'Ansolo_-_Live';'Ansolo';'Apollonia';'Armin_van_Buuren_-_ASOT_700_Miami';'Armin_van_Buuren_-_Main';'Avicii';'Axwell_Ingrosso';'Big_Gigantic';'BlasterjaxxKort';'BlasterjaxxLang';'Boys_Noise';'Breathe_Carolina';'Camilo_Franco_Live';'Carl_Cox_27march';'Carl_Cox';'Cash_Cash_-_Live';'Cazette_-_Live';'Cedric_Gervais_-_Live';'Claptone';'Dannic';'Dash_Berlin';'David_Guetta';'Dirty_South';'Duke_Dumont';'Dyro';'Eats_Everything';'Fedde_Le_Grand';'GTA';'Galantis';'Gorgon_City';'Grandtheft';'Guy_Gerber';'Guy_J';'Hardwell';'Heatbeat';'Hot_Since_82';'Jauz';'John_Digweed';'Jordy_Dazz';'Joris_Voorn';'Joseph_Capriati';'Klingande';'Knife_Party1';'Knife_Party2';'Kolsch';'Krewella';'Ksuke';'Laidback_LukeKort';'Laidback_Luke_Lang';'Lauren_Lane';'Live_Ultra_Music_Festival_UMF_2015_(Miami)';'MAKJ';'MaRLo';'Marco_Bailey';'Martin_Garrix';'Milo_and_Otis';'Netsky';'Nic_Fanciulli';'NickiRomero';'Oliver_Heldens';'Party_Favor';'Paul_van_Dyk';'Pete_Tong';'Raiden';'Robin_SchulzKort';'Robin_SchulzLang';'Sasha';'Seth_Troxler';'Sick_Individuals';'Skrillex_and_Jack_U';'Skrillex';'Snake';'Steve_Angello';'Steve_Aoki';'Sunnery-James_-_Ryan-Marciano';'TIESTO';'Tchami';'The_Martinez_Brothers';'Tommy_TrashKort';'Tommy_TrashLang';'UMEK';'W_and_W_Long';'W_and_W_Short';'Yellow_ClawShort';'Yellow_Claw_Long';'Zeds_Dead';'stefano';'tINI'};
    DJfilnavn = {'3LAU';'AAA3_Are_Legend';'Above_and_Beyond';'Adam_Beyer_-_Ida_Engberg';'Adrian_Hour';'Afrojack';'Agoria';'Alesso';'Andhim_-_Live';'Andrew_Bayer';'Andrew_Rayel';'Ansolo_-_Live';'Apollonia';'Armin_van_Buuren_-_ASOT_700_Miami';'Armin_van_Buuren_-_Main';'Avicii';'Axwell_Ingrosso';'Big_Gigantic';'BlasterjaxxLang';'Boys_Noise';'Breathe_Carolina';'Camilo_Franco_Live';'Carl_Cox_27march';'Carl_Cox';'Cash_Cash_-_Live';'Cazette_-_Live';'Cedric_Gervais_-_Live';'Claptone';'Dannic';'Dash_Berlin';'David_Guetta';'Dirty_South';'Duke_Dumont';'Dyro';'Eats_Everything';'Fedde_Le_Grand';'GTA';'Galantis';'Gorgon_City';'Grandtheft';'Guy_Gerber';'Guy_J';'Hardwell';'Heatbeat';'Hot_Since_82';'Jauz';'John_Digweed';'Jordy_Dazz';'Joris_Voorn';'Joseph_Capriati';'Klingande';'Knife_Party2';'Kolsch';'Krewella';'Ksuke';'Laidback_Luke_Lang';'Lauren_Lane';'MAKJ';'MaRLo';'Marco_Bailey';'Martin_Garrix';'Milo_and_Otis';'Netsky';'Nic_Fanciulli';'NickiRomero';'Oliver_Heldens';'Party_Favor';'Paul_van_Dyk';'Pete_Tong';'Raiden';'Robin_SchulzLang';'Sasha';'Seth_Troxler';'Sick_Individuals';'Skrillex_and_Jack_U';'Snake';'Steve_Angello';'Steve_Aoki';'Sunnery-James_-_Ryan-Marciano';'TIESTO';'Tchami';'The_Martinez_Brothers';'Tommy_TrashLang';'UMEK';'W_and_W_Long';'W_and_W_Short';'Yellow_Claw_Long';'Zeds_Dead';'stefano';'tINI'};
    mappe = 'djset';
    s5 = '_interval=[600s,1200s]_noMD5.csv';

end

% interval = {'[0s,600s]';'[600s,1200s]';'[1200s,1800s]';'[1800s,2400s]';'[2400s,3000s];
% lave filnavne og læse dem

%LOWENERGY-VALUE
AntalDJs = size(DJfilnavn,1)


    
%lave filnavne og læse dem



for iDJ = 1:AntalDJs

s1 = '/Users/jespersteenandersen/Documents/SB_WEBDAV/system/770_job/'
s2 = '/mirtoolbox/';
s3 = '/results/';
s4 = '_feat=';


fileNames{iDJ,1} = strcat(s1,mappe,s2,feature,s3,DJfilnavn{iDJ},s4,feature,s5);

if exist(fileNames{iDJ,1},'file') == 2
    
Matrix{iDJ,1} = csvread(fileNames{iDJ,1});

else
    Matrix{iDJ,1} = [0]
end


% loade lowenergy
% 
% feature2 = 'lowenergy'
% 
% for iDJ = 1:AntalDJs
% 
% s1 = '/Users/jespersteenandersen/Documents/SB_WEBDAV/system/770_job/'
% s2 = '/mirtoolbox/';
% s3 = '/results/';
% s4 = '_feat=';
% 
% 
% fileNames2{iDJ,1} = strcat(s1,mappe,s2,feature2,s3,DJfilnavn{iDJ},s4,feature2,s5);
% % fileNames2{iDJ,1} = strcat(s1,feature2,s5,mappe,s2,DJfilnavn{iDJ},s3,feature2,s4);
% Matrix2{iDJ,1} = csvread(fileNames2{iDJ,1});
% % MatrixTempo{iDJ,1} = csvread(fileNames2{iDJ,1});

% end

% reparere filnavnene
% søgog erstattet filenames, så de kan læses i grafen

for iDJ = 1:AntalDJs

DJ1{iDJ,1} = strrep(DJfilnavn{iDJ,1}, '_', ' ');
DJ2{iDJ,1} = strrep(DJ1{iDJ,1}, 'Boys Noise', 'Boys Noize');
DJ3{iDJ,1} = strrep(DJ2{iDJ,1}, 'Tommy TrashLang', 'Tommy Trash');
DJ{iDJ,1} = strrep(DJ3{iDJ,1}, 'JayZ KanyeWest', 'Jay Z & Kanye West');

% tid{iDJ,1} = Matrix{iDJ,1}(1,:);
% movingmode{iDJ,1} = mode(tid{iDJ,1}:tid{iDJ,1}+5)

end

end


