function [ saveEachTableParameters, sel ] = VyberNejlepsichRadku(table1,nrofpatients,skok,label_trainMMR,vystup )
%% Funkce pro selekci mRMR a ulozeni do promenne Cell

%% Vypocet
saveEachTableParameters = cell(1); % priprava promennych 
 for num=1:119
disp(['pocitam pro ' num2str(num) ' parametru ']);
addpath('mRMR');
% Diskretizace
table1M = cell2mat(table1(2:skok+1,2:nrofpatients+1));

th1 = mean(table1M) - std(table1M);
th2 = mean(table1M) + std(table1M);

th1 = repmat(th1, size(table1M,1), 1);
th2 = repmat(th2, size(table1M,1), 1);

mask1 = table1M < th1;
mask3 = table1M > th2;        
mask2 = (mask1+mask3) == 0;

table1M(mask1) = -1;
table1M(mask2) = 0;
table1M(mask3) = 1;

sel = mrmr_mid_d(table1M', label_trainMMR', num);


for i=1:length(sel)
    new_table1(i+1,1:nrofpatients+1) = table1(sel(i)+1,1:nrofpatients+1);
end


 [outputClassMMr,label_trainMMR2] = ClasificationTableMMR(new_table1,nrofpatients, label_trainMMR, length(sel)+1);
 [outputClassMMr2] = ComputeParametersMMR(outputClassMMr,label_trainMMR2,vystup, length(sel)+1);
 
 saveEachTableParameters(num+1,1) = num2cell(num);
 saveEachTableParameters(num+1,2:5) = outputClassMMr2(2,2:5);

 end
end

