function X=ca(rule,n,t)
x0=zeros(1,n);
x0(floor(n/2))=1;
X=zeros(t,n);
X(1,:)=x0;
for i=2:t
    x0=X(i-1,:);
    xpred=X(i-1,[end,1:end-1]);
    xpo=X(i-1,[2:end,1]);
    misto=[4,2,1]*[xpred;x0;xpo];
    X(i,:)=bitget(rule,misto+1);
end;
image(cat(3,1-X,1-X,1-X))