Skip to main content
. 2020 Dec 23;26(1):20. doi: 10.3390/molecules26010020
Algorithm 2 Simulation Algorithm Using PC (Matlab)
pos=zeros(1000,46); % class +
neg=zeros(1000,46); % class –
Aa=zeros(1000,46); % class Aa
AaEx=PCA; % Principal component
AaExn=zeros(20,46);
k=1;
while k < 21 % the # PC was 20
    AaExn(k,:)=(AaEx(k,:)-min(AaEx(k,:)))./(max(AaEx(k,:))-min(AaEx(k,:)));
     r=1;
     while r < 51
      one=ones(1,46);
       s=1;
        while s < 47
        one(s)=one(s) * rand();
        s=s+1;
        end
       Ap=aleat(140,300);
       Apl=aleat(0,100);
       Aa(50 * (k-1)+r,:)=(Ap. * AaExn(k,:))+one-Apl;
       r=r+1;
     end
     k=k+1;
end
i=1;
Thd=20;
while i < 1001
     b=aleat(0.02,0.5); % parameter b
     Cqp=aleat(10,40); % Cq for +
     Cqn=aleat(41,100); % Cq for –
     Ap=aleat(40,2000); % parameter Ap
     j=1;
     Cmp=((log((Ap/Thd)-1))/b)+Cqp; % Cq for +
     Cmn=((log((Ap/Thd)-1))/b)+Cqn; %Cq for –
     while j < 47
       pos(i,j)=(Ap./(1+exp(-b. * (j-Cmp))))+(6 * rand());
       neg(i,j)=(Ap./(1+exp(-b. * (j-Cmn))))+(6 * rand());
       j=j+1;
      end
     i=i+1;
end
X=[pos; neg; Aa];