Information like this is bound to change over the course of time, and that is the rationale behind making the information available on a webpage. Hence, note the information at the top of the page indicating Matlab's version and the semester, which this document was written last updated for. In response to feedback, I may update this page more often; look at the bottom for a more precise date.
You are welcome to tell others about this page and to create a link to it. Instead of providing a live link to this page, I suggest to link to my homepage like I have done above.
As always, I appreciate your comments and feedback about this page. However, please understand that I am not the answer box for Matlab questions as such on this campus. I am just trying to make my expertise available to the community so that everyone can get started successfully, but you will have to study the documentation yourself to actually solve your problem. If you are interested in a class on the subject, consider our Math 426, which is a basic but thorough introduction.
The above is my statement, based on using Matlab extensively since 1991 in the teaching of Numerical Analysis and in research involving computational simulations of a variety of application problems. For the official answer, check out http://www.mathworks.com, the webpage of the MathWorks, Inc., maker of Matlab.
At present (and this may change eventually), Matlab starts up
in the folder C:\MATLAB7\work
or similar;
see the "Current Directory" box at the top of the desktop.
This is a system folder on the local system and not
writeable for a user.
So, you must change directory in order to be able to save
files later on.
You can use the browse option (button saying "..." next to the
current directory) for this, but let me use Matlab commands
here for simplicity.
You should change to the S:
drive first by cd S:;
this is the AFS area accessible from all systems at UMBC and over the internet.
I suggest to create a folder for your project to work on:
For instance, if you are a student in Math 426, you may want to
create a folder for this class by mkdir Math426,
then change into it by cd Math426.
In turn, create a directory for each class or homework by,
say, mkdir Homework1 and change to it by cd Homework1.
Check what the "Current Directory" says or say pwd
in the command window, which stands for "print working directory".
In the previous item on starting Matlab under Windows, I discuss in some detail how to change directory after starting Matlab. Under Linux, it makes more sense to change directory first, using the Unix/Linux commands mkdir and cd (and pwd and ls to inquire). Then, start Matlab in your desired directory which will make all files associated with your project accessible.
So, we want to start Matlab (i) without its desktop and (ii) without any graphics (including the splash screen); this can be accomplished by saying matlab -nodisplay. You could also use matlab -nodisplay -nojvm, which additionally does not start the JVM. In both cases, attempts to open plot and similar windows might be simply ignored or attempts to open the documentation windows might result in various error messages.
The above is the most restrictive way in which to start Matlab. If in fact your local machine is Linux, you could use matlab -nodesktop -nosplash, which (i) does not start the desktop and (ii) suppresses the splash screen (the small window with Matlab's logo and version number that usually pops up briefly). But this way of starting Matlab does start the JVM and you have access to the HelpBrowser as well as to plot windows, if you later so desire (and are willing to wait for those to open, which might take a while depending on your network connection).
nohup \matlab -nojvm -nodisplay < driver.m >& driver.log &Here, the backslash in \matlab circumvents any possible alias you might have for Matlab (just to be on the safe side) and the options -nojvm -nodisplay suppress the starting of the JVM (and the startup of the desktop) and the opening of any windows. The final ampersand ("&") actually puts the command into the background, i.e., gives you the command-line prompt in your shell back. Aside from entering any usual commands now, you could in particular log out, without hanging or killing your job, because of the standard Unix/Linux command nohup before the call to Matlab. The file driver.m that must be present in the current directory is a Matlab script file (not: function file) that lists the commands to be executed by your job; if your job is actually performed by a function, this script file can simply be a single line that calls your function.
For the remaining elements in the command-line above, I am assuming you are using the csh or tcsh shell; in other shells, the redirections may be slightly different. The "<" redirects stdin (namely from file driver.m) into Matlab. For the background run not to hang, there must not be any screen output, so the ">&" redirects both stdout and stderr to the file driver.log; this file must not exist initially. Again, the redirection commands may be different in other shells and slight variations are possible (such as overwriting an existing log file).
The command help functionname displays the help on the function with name functionname; this functions must be in the current directory or be found on the search path (try which functionname). Technically, this displays the comments at the beginning of the m-file with name functionname.m up to the first blank line or the first line of code.
If you do not know the name of the function on which you wish to see help, you can try the lookfor keyword command, which searches for a keyword in m-files on the search path; more precisely, it only searches the very first line of the comments in those m-file (technically called the H1 line by Matlab).
Besides starting the HelpBrowser as such (and then using its features to find what you want), you can start it up with the help on a particular function with name functionname by saying doc functionname; I have found that one sometimes has to issue this command twice to get the desired effect, though. If the HelpBrowser is not open yet, it is started up, or if it is already open, the page displayed is changed. You should see the help on the function in the main window of the HelpBrowser now. This is similar and in some cases identical to the one obtained by saying help functionname, but has often more information and additional examples; particularly, for graphics commands, you will find full examples displayed here, which would not be available by using help in the command window alone. You may want to compare the information available by saying help plot and doc plot.
As a general caution, you may have to wait for a moment for the HelpBrowser to come up. I suggest to resize the window to make it wide enough such that you can fit a full page in the right-hand part of the window, while still being able to read the titles of sections in the left-hand part.
The left-hand side of the window, the HelpNavigator, should show a table-of-contents with items such as "Begin Here", "Release Notes", "Installation", "MATLAB", and more. If you do not see these, make sure that the "Contents" tab is selected in the HelpNavigator. If you are missing the entire HelpNavigator, use the pull-down menu under "View" and make sure that "HelpNavigator" is selected there.
My recommendation for learning about Matlab and how to use it is to study the Getting Started guide, which is the first item under "MATLAB"; if not already visible, expand the table-of-contents of "MATLAB" by clicking on its plus "+" sign. You can see the table-of-contents of the Getting Started guide by clicking its plus sign. The first two sections "Introduction" and "Matrices and Arrays" explain the philosophy of Matlab and walk you through the most basic commands; you should enter them in the command window yourself The sections "Graphics" and "Programming" explain the use of graphics commands and how to program m-files in Matlab, respectively. Finally, the section "Desktop Tools and Development Environment" explains in details the features of the desktop environment.