% This function defines the operation of two-input multiplexer. % INPUT: % a1: the stochastic sequence of the first input for the mux; % a2: the stochastic sequence of the second input for the mux; % a3: the stochastic sequence of the selection input for the mux; % OUTPUT: % a: the stochastic sequence of the output for the mux. % Copyright @ The authors, 2012. function a= mux2(a1,a2,a3) a=a1.*(1.-a3)+a2.*a3;