# Gardner Lab

## Corn server

Stanford provides a campus wide Matlab license that everyone can connect to. This section will get your computer set up to use it.

1. Check if you have XQuartz installed First check to see if you have XQuartz installed. XQuartz (formerly X11) is a unix window management system which allows the matlab running on the corn server to display figures on your screen. Click on the magnifying glass at top right in the menu bar, type in “XQuartz” without the quotes and if it fills it in and there is an application to start, then hit enter, and it should start XQuartz. If not, it won't find X11 and it won't start, so you will need to install it.
2. Install XQuartz Skip this if in the above step you were able to start XQuartz. Otherwise, you may be brought to a dialog that tells you that XQuartz is no longer part of Mac OS but can be installed. Follow the directions and download and install XQuartz. You can also download X11/XQuartz here or as part of the XCode package here: Xcode. Once XQuartz is installed, make sure to run it, by clicking on its icon or going to spotlight as above.
3. Check XQuartz is running If XQuartz is open, you should see an icon like the following in your task bar to show that it is running:

1. login to corn Type into the Terminal command line (get to the terminal by going to spotlight -i.e. magnifying glass at top right - and typing terminal), the following (make sure to change jlg to your sunet ID!!!)
ssh -X jlg@corn.stanford.edu
2. Enter your sunet password When prompted (nothing will show, this is normal) It should look something like the following
3. Load up matlab module When you have logged in, then you need to load and start matlab. Type the following in and press enter
module load matlab
4. Load tutorial data Run the following commands to get the tutorial data
mkdir nepr207
cd nepr207
curl http://gru.stanford.edu/pub/modtut/modtut.mat > modtut.mat
5. Run matlab You are ready to start up matlab now. It is probably a good idea to run it without the desktop, which may work better:
matlab -nodesktop
6. Matlab GUI check If the Matlab splash screen then pops up on your desktop, great! If not, it might be because X11 is not working, try the steps above from scratch to make sure that X11 is installed and running. If X11 is not running correctly or is an older version (There were issues previously running with Yosemite - as of XQuartz 2.7.11 and Mac OS 10.12.1 things are working), you may see the error
Warning: No display specified.  You will not be able to display graphics on the screen.

Another possible problem is that you may not be able to load the module, and you will see the following

module: Command not found.

If you see this message after typing “module load matlab”, this means you have an older account where the module environment is not set up properly. Follow instructions here.