File Exchange Pick of the Week

Our best user submissions

ip to location

In the last few weeks I have been adding a some location information to this blog, from the map to the right that shows where all the weekly visits to this blog are coming from, to the map that was picked two weeks ago that shows where File Exchange authors are located in the world. Continuing with that location theme is a quick little tool that will tell you what country a given IP address is registered to. For instance, I am writing this post from

>> ip2loc('')
ans =

This IP happens to be a hotel I am staying at tonight before I give a talk about MATLAB Friday afternoon.

I liked that this was a simple implementation, and that data from an outside source was able to be brought easily into MATLAB and used here. When I first found the application, I thought it would be nice to have a command line version. Divakar was kind enough to modify his code and post it here.

  • print
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.