Using Matlab to send digital signal from National Instruments device
The link provided by Warren is for analogue. Click here for digital.

From what I understand you are trying to get Matlab to send a digital signal to the NI and then the NI sends a signal to the MUX. If that is what you are trying to do then you need have code in your NI to take the data received from Matlab and transmit it to the MUX. 

You need to distinguish are you only trying to communicate with the NI or are you trying to programme the firmware of the NI using Matlab as well?

If you are only trying to communicate with it then that link is all you need (provided you have already coded the NI to handle the data)