% experiment 3 
% Martin Radvansky 
% Diplomova prace 2022
% Upravene nastavovani koeficientu primek pro Sugeno

function [fis_sugeno] = napln_fis_primkyS(fis_sugeno,pozice_datax,pozice_datay)
%y = ax +b
  coefficients = polyfit([pozice_datax(1,1), pozice_datax(1,2)], [pozice_datay(1,1), pozice_datay(1,2)], 1);
  fis_sugeno.Outputs.MembershipFunctions(1, 1).Parameters = coefficients;  
  
  coefficients = polyfit([pozice_datax(2,1), pozice_datax(2,2)], [pozice_datay(2,1), pozice_datay(2,2)], 1);
  fis_sugeno.Outputs.MembershipFunctions(1, 2).Parameters = coefficients; 
  
  coefficients = polyfit([pozice_datax(3,1), pozice_datax(3,2)], [pozice_datay(3,1), pozice_datay(3,2)], 1);
  fis_sugeno.Outputs.MembershipFunctions(1, 3).Parameters = coefficients; 
  
  coefficients = polyfit([pozice_datax(4,1), pozice_datax(4,2)], [pozice_datay(4,1), pozice_datay(4,2)], 1);
  fis_sugeno.Outputs.MembershipFunctions(1, 4).Parameters = coefficients; 
  
  coefficients = polyfit([pozice_datax(5,1), pozice_datax(5,2)], [pozice_datay(5,1), pozice_datay(5,2)], 1);
  fis_sugeno.Outputs.MembershipFunctions(1, 5).Parameters = coefficients; 
   
end