function [X]=make_X(s,g,frm)
%make binary matrix for human codes, each frame and each AU  
  load /home/gwen/rutgers/CODES/au_fr
   %au_fr 1=subject 2=au 3=intensity 4:6=start,peak,stop

g=g(:)';

for em=1:size(g,2)
  f=find(au_fr(:,1)==s&au_fr(:,2)==g(em)&au_fr(:,4)>0);
  for j=1:size(f,1);
    X(au_fr(f(j),4):au_fr(f(j),6),em)=1;%start:stop
  end
end

if(size(X,1)<frm(end)|size(X,2)<size(g,2))%ensure dim(X)
  X(frm(end),size(g,2))=0;
end


X=2*X(frm,:)-1;%select only frames with output, X=+-1
