No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

3.2 | 6 ratings Rate this file 12 Downloads (last 30 days) File Size: 2.81 KB File ID: #8233 Version: 1.0

Get MAC and IP Address, Network IDs


Steven Huang (view profile)


06 Aug 2005 (Updated )

This c-mex function obtains the MAC and IP addresses and IDs of the computer.

| Watch this File

File Information

Obtain physical address (MAC) and IP address of the computer. Acts as an MATLAB version 'ipconfig'.

MATLAB release MATLAB 6.5 (R13)
Other requirements VC6 ++
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
04 May 2012 Feng Shengzhen

Hi Xiangrui,
use command "computer" could get the os info. Then different local command can be correctly chosen.

Comment only
01 Feb 2012 Xiangrui Li

Here are a way to get MAC address for different systems:
system('getmac'); % windows
system('netstat -I en0'); % mac
system('/sbin/ifconfig eth0'); linux


Comment only
29 Dec 2011 Peter

Peter (view profile)

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


Comment only
29 Sep 2011 Tsinghua

15 Sep 2005 Najeeb Ahmed

this software solve my problem i am really now full relex now solve my mentally tention.

16 Aug 2005 Michael Kleder

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:

15 Aug 2005 Marcelo Pisani

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.

08 Aug 2005 Stephen LL

Here is another solution for getting the IP address that should work on most computers.

08 Aug 2005 urs (us) schwarz

a more MLbbish solution could look like this (on wintel boxes):
a=strread(evalc('!ipconfig -all'),...
a([strmatch('IP A',a),...

Contact us