By default Mac OS/X changes the hostname based on whether or not the system is connected to a network. In addition the hostname will be different for different network (IP) numbers. Matlab requires that the hostname specified in the license file match the hostname of the system running the system. Therefore, Mac OS/X's changing of the hostname will cause the license file validation to fail when trying to run Matlab.
The solution is to set your laptop to have a static hostname. This can be done by making the following changes on your laptop:
Edit the /etc/hostconfig file. Look for the line starting with HOSTNAME and change it to "HOSTNAME=hname", where hname is the hostname you want to give your laptop. If /etc/hostconfig file does not have a line starting with HOSTNAME, add one to the end of the file.
Edit the /etc/hosts file. Look for the line starthing with 127.0.0.1. Add the same hostname you used above to the end of this line, e.g. "127.0.0.1 localhost hname".
Edit the Matlab license file, which usually is in /Applications/MATLABnnn/etc/license.dat where nnn is a Matlab version number. Note, you cannot edit this file by double clicking on it - you must first start the text editor and then open the file within the editor. Make sure the line starting with SERVER has the same hostname you used above, e.g "SERVER hname ID=164896 27000".