Obtain physical address (MAC) and IP address of the computer. Acts as an MATLAB version 'ipconfig'.
use command "computer" could get the os info. Then different local command can be correctly chosen.
Here are a way to get MAC address for different systems:
system('getmac'); % windows
system('netstat -I en0'); % mac
system('/sbin/ifconfig eth0'); linux
I love the speed of this function compared to the dos ipconfig solution. However, I cant seem to figure out how to store the displayed information into a variable?
I have never worked with the mex files, so trying to alter it to spit out output is too hard for me.
Would appreciate help
this software solve my problem i am really now full relex now solve my mentally tention.
Good approach if java isn't an option, such as when running matlab with "matlab -nojvm" or if a Java call isn't desired.
If Java is an option, I've had good luck with:
The authour does not provide instructions of how to compile / call the file in Matlab. The solution proposed here by Stephen could not get the MAC number. The solution proposed by Schwarz will fail in non-english versions of IPCONFIG.EXE.
Here is another solution for getting the IP address that should work on most computers.
a more MLbbish solution could look like this (on wintel boxes):
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.