Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

function create_GAMA_XI(L,C)

% html conjugate gradient


global GAMA %XI
Nfa=20;
Np=3;
alpha=0;
gama=100;

Xc=(1:C)';
Yc=(1:L)';

stepPH=C/(Nfa-1);
stepPV=L/(Nfa-1);

Mf_params_H=zeros(Nfa,4);
for i=1:Nfa % MFs centers in H direction
centers_H=stepPH*(i-1);
Mf_params_H(i,:)=[centers_H-stepPH centers_H
centers_H centers_H+stepPH];
end
Mf_params_V=zeros(Nfa,4);
for i=1:Nfa % MFs centers in V direction
centers_V=stepPV*(i-1);
Mf_params_V(i,:)=[centers_V-stepPV centers_V
centers_V centers_V+stepPV];
end
%%% evaluation des A et b
for j=1:size(Mf_params_H,1) % calcul
de Xi H (X):,Nbr
Mf_H(j,:)=trapmf(Xc,Mf_params_H(j,:));
end
for j=1:size(Mf_params_V,1) % calcul
de Xi V (V)

Mf_V(j,:)=trapmf(Yc,Mf_params_V(j,:));
end
A=0;
Xi=[];

for i=1:L
for j=1:C
Mf_VxH=Mf_V(:,i)*(Mf_H(:,j))';
Mf_VxH_col=Mf_VxH(:);

Xi_VxH_col=Mf_VxH_col/sum(Mf_VxH_col);
A=A+(Xi_VxH_col*Xi_VxH_col');
% Xi=[Xi Xi_VxH_col];

end

end
GAMA=inv(alpha*A+eye(size(A,1))/gama);

You might also like