function [Data,AntalDJs,DJliste,Sektion,Variables] = getGenericData(feature)

% GetGenericData - tager data for en given feature og beregner Median, Mean, Std og IQR. Data skaffes for alle DJsets, men alle værdier for alle sektioner.

% clearvars -except Pines2 LLEdata DJnames LLEdataTest LLEdataAlleDJs LLEdataTestDJs Matrix AntalDJs DJ DJfilnavn fileNames
% GetGenericData - tager data for en given feature og beregner Median, Mean, Std og IQR
% getFeature('rms',')

% EDData2 = [];
% feature = 'eventdensity';

dataset = 4;
  
%feature = 'pulseclarity';
%Feature = 'ED';
EDData = [];
clear Mean Median Std IQR
% getfeature =
[Matrix,DJliste,Sektion] = getAllDJs(feature)

% if hentdata == 1
%     clear [Matrix,AntalDJs,DJ,DJfilnavn,fileNames,AntalDJs]
%     [Matrix,DJ,DJfilnavn,fileNames,AntalDJs] = getFeature(feature,dataset);
% else
% end


AntalDJs = size(Matrix,1);

for Case = 1:AntalDJs   

    if size(Matrix{Case,1}) < 3;
       MeanED(Case) = 0; 
   MedianED(Case) = 0;
   StdED(Case) = 0;
   IQRED(Case) = 0;
    
    else
   MeanED(Case) = nanmean(Matrix{Case,1}(3,:)); 
   MedianED(Case) = nanmedian(Matrix{Case,1}(3,:));
   StdED(Case) = nanstd(Matrix{Case,1}(3,:));
   IQRED(Case) = quantile(Matrix{Case,1}(3,:),0.75) - quantile(Matrix{Case,1}(3,:),0.25);
   
%    subplot(round(AntalDJs/2),2,Case)
%    plot(Matrix{Case,1}(1,:),Matrix{Case,1}(3,:))
%    % legend({'Beatspectrum','afledede abs*10'},'FontSize',8,'FontWeight','bold')
%    title(DJ{Case,1})
%    ylim([0  10])
%    set(gcf,'name','Eventdensity')
%   % xlim([0  2])
    end
end

% figure;
% subplot(3,1,1)
% bar(1:AntalDJs,MeanED)
% set(gca,'XTick',1:AntalDJs)
% set(gca,'XTickLabel',DJ)
% set(gca,'XTickLabelRotation',90)
% title([Feature, '/ mean']);
% 
% subplot(3,1,2);
% bar(1:AntalDJs,StdED)
% set(gca,'XTick',1:AntalDJs)
% set(gca,'XTickLabel',DJ)
% set(gca,'XTickLabelRotation',90)
% title([Feature, '/ std']);
% 
% 
% subplot(3,1,3);
% bar(1:AntalDJs,IQRED)
% set(gca,'XTick',1:AntalDJs)
% set(gca,'XTickLabel',DJ)
% set(gca,'XTickLabelRotation',90)
% title([Feature, '/ IQR']);

Data = [MeanED',MedianED',StdED',IQRED'];
Variables = {strcat('Mean_',feature),strcat('Median_',feature),strcat('Std_',feature),strcat('IQR_',feature)};

% EDData2 = [EDData2;EDData];


