What's defineTOSEnvironment.m?

This is a Matlab script that defines a few things that are useful when working with TinyOS and Matlab:

1.  It defines several global variables useful to TinyOS, such as TOS_BCAST_ADDR=65535 or GROUP_ID = 125

2.  It adds the tinyos-1.x/tools/matlab subdirectories to the Matlab path.  Whenever a function is called, matlab looks for the file that defines that function according to it's path.  First, the current directory is searched and then all directories in the path are searched.  If the function is not found on the path, an error is returned.  By adding the tinyos-1.x/tools/matlab subdirectories to the Matlab path, we can call any function in this directory from any other function.

You can create a separate "define...Environment" file for anything you like, including particular apps or particular user preferences. This is useful so that different users and different apps can use different paths, reducing name conflicts.