You can choose which interface to use with the LocalHost
property when calling udp()
:
http://www.mathworks.com/help/instrument/localhost.html
So in your case
u = udp(rhost,rport,'LocalHost','IP_OF_NIC')
Btw, in case you're curious how to approach this: You can find all properties of an object with propinfo(u)
. Then find the documentation for each property which sounds like what you're looking for.