====== Classification tutorial setup ======
If you have used matlab before and are reasonably comfortable downloading and installing files, just go ahead and follow the directions [[:mrtools:tutorialsclassify|here]]. Otherwise, follow the directions below to run on a [[#mac|Mac with Matlab]].
If instead you want to run on your own laptop and don't have Matlab installed, then it is possible to run this using the corn server, but it's a bit more involved and doesn't always work great - so I don't necessarily recommend it. Here are instructions if you want to try [[#Corn_server|below]].
Alternatively, if you will be using Matlab a lot in the future and would like to purchase a license, you may be able to purchase a student license (though that license has a limit on matrix sizes). See [[https://www.mathworks.com/store/link/products/student|https://www.mathworks.com/store/link/products/student]].
If you want to run on Windows then you can follow instructions [[http://stanford.edu/~mzahr/extras/cme292/spring2014/AccessToMatlabAndAlternatives.pdf|here]], but really, must you run Windows?
[[psych164classification|iPython Classification tutorial]]
===== Mac =====
- **Mac with Matlab** You will need to locate a Mac with Matlab installed. Many residential halls have such a Mac as well as the Library.
- **Download tutorial files** The tutorial requires a few files that you should be able to download to the Desktop. First, follow this link [[http://gru.stanford.edu/pub/classification.tar.gz|http://gru.stanford.edu/pub/classification.tar.gz]] It should download a file called classification.tar.gz to your computer.
- **Move tutorial files to Desktop** It will be easiest if you move the downloaded file "classification.tar" to your Desktop (note it may say, classification.tar.gz if it is still compressed - this should not matter). In Safari you can click on the icon at top right with the arrow pointing downwards, and you should be able to drag and drop. If you are using some other browser, or can't get that to work, then Navigate with Finder to the directory "Downloads" (which is under your User directory) and then drag and drop that to the Desktop.
- **Uncompress/tar the file** The file classification.tar is a special format which makes it easier to send as a single file, but contains a directory full of files. To undo that, just double-click on it and it should turn into a directory called classification. Inside should be a bunch of files with the .m extension (matlab files) and a directory called mrUtilities.
- **Start Matlab** Go ahead and start Matlab. You should be able to find an icon like the following and click on it{{:matlabicon.png|}} If you can't find the icon go to search (magnifying glass in top right) and type matlab...
- **Install tutorial** Now you need to tell matlab where to find the files we just downloaded. You should type the following commandsaddpath(genpath('~/Desktop/classification'))
It should look like this
classifyTest
and see the following: ssh -X jlg@corn.stanford.edu
- **Enter your sunet password** When prompted (nothing will show, this is normal) It should look something like the following
module load matlab/r2013b
- **Load classification tutorial** Run the following commands to get the classification tutorial code
wget http://gru.stanford.edu/pub/classification.tar.gz
gunzip classification.tar.gz
tar xf classification.tar
- **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
- **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. 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.
For Mac OS Sierra, the problem may be that the location of the XAuth program needs to be specified in the file /etc/ssh/ssh_config. To fix that you can do the following:
cd /etc/ssh
sudo emacs ssh_config
Add the following line anywhere in the file: XAuthLocation /usr/X11/bin/xauth
Save the file by doing ctrl-x ctrl-s and quit by doing ctrl-x ctrl-c
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 [[https://web.stanford.edu/group/farmshare/cgi-bin/wiki/index.php/Dotfiles|here]]. If everything went well, you should see the following addpath(genpath('classification'));
- **Test** If everything worked ok, you should be able to type the following command:classifyTest
and see the following: