MatOFF Frequently Asked Questions
General Questions & Answers
What is MatOFF? MatOFF is a powerful tool for analyzing neurophysiological data. It is intended to operate on data collected from single-unit recording experiments, especially behaviorally-based experiments. It is well suited to data sets with stored spike times, one or two channels of digitized analog data (e.g., eye position signals), and time-stamped events. There is no charge for private or commercial use. Source code is available.
Where does MatOFF come from? MatOFF is a third generation of the primary data analysis tool used in the Laboratory of Systems Neuroscience at the Nation Institute of Mental Health. The earlier versions ran on PDP-11 (called KOFF) and DOS (called PCOFF) platforms. MatOFF, which runs under MATLAB (MathWorks, Inc.), is the most complete and flexible version developed. It was written by Andrew Mitz, the laboratory Staff Scientist.
How many users are there? About 30 to 40 people in at least 6 countries have used, or currently use various version of this analysis tool.
What are its strengths and weaknesses?
Strengths: When behavior is divided into epoch (behavioral trials) MatOFF is exceptional at finding relevant trials based on complex behavioral event criteria. The extraction requires no programming, just point-and-click on menus or simple typed instructions. Once the trials are extracted, MatOFF generates plots of rasters, histograms, and analog data. Graphical layout is simple and can be adjusted using either typed commands or the graphical user interface. MatOFF has a scripting language for processing large data sets, and can even incorporate MATLAB scripts into the data processing stream.
Weaknesses: MatOFF cannot handle cross-correlations or other simultaneous multi-channel unit analysis. It is not intended for spike-triggered averaging or field-potential studies. It cannot handle spike waveforms, just spike times. It does not incorporate a broad range of signal processing functions (e.g., FFT, CUMSUM, etc.) like some other analysis tools.
How do I report a problem or bug? Send a request to firstname.lastname@example.org.
How do I request a new feature? Send a request to email@example.com.
What data files can MatOFF read?
MatOFF can read files created by NIMH Cortex, the data acquisition system written in the Laboratory of Neuropsychology, National Institutes of Mental Health. MatOFF can read files created by Plexon, using the Plexon-to-Cortex conversion program (PLX2CTX), or the MATLAB program mgPLX2CTX, both distributed with MatOFF. MatOFF can read files created by the latest Alpha-Omega Engineering AlphaLAB system because that system provides Plexon output files. A new Neuroshare to Cortex converter will be available soon that will translate any Neuroshare compatible file (see http://neuroshare.sourceforge.net/index.shtml) to the Cortex format.
Does it have NeuroShare support? MatOFF neuroshare support is currently in development.
How can I get it to read a file from my data collection program? The MatOFF file format is explained in detail in the MatOFF documentation in the /technical directory. You are welcome to write a conversion program to the native MatOFF file format, or to one of the other supported formats. What is the internal format of MatOFF data files? The internal format of MatOFF files is in the file MatOFF_file_structure.doc, under the \docs\technical directory tree of the MatOFF distribution.
What is the internal format of MatOFF data files?The internal format of MatOFF files is in the file MatOFF_file_structure.doc, under the \docs\technical directory tree of the MatOFF distribution.
Getting Started How do I obtain MatOFF?
Go to and find the link to MatOFF. Open the MatOFF documentation and look for the Download link on the left.
Do I need MATLAB to run it?
Yes. You will need Version R11.1 or later.
Is it a big program?
MatOFF is remarkably small. The actual MATLAB files are under 1 megabyte of programming. With full documentation, the MatOFF installation file is just over 1.5 Mb.
Where do I start?
The documentation has a Getting Started page. That is a great place to start. Once you learn how to start up MatOFF, there are two example data files. One is the complete_with_datafile under the example_files directory. It is a complete, well annotated, example with a data file. The other example can use your own Cortex data file, or a supplied one. It can be found in the ezstart directory.
MatOFF crashes as soon as I start it.
Follow the getting_started.html document carefully. Make sure the matoff\menu subdirectory is included in the MATLAB path. See the MATLAB PATH command. If the problem continues, send an email to firstname.lastname@example.org for help.
I gave the File command, but it rejected the file.
If you are starting with a Cortex file, you must run the Makdat command first. If you are starting with a Plexon file, run plx2ctx or mgplx2ctx on the Plexon file, and then run the Makdat command on the resulting file. If you have a Cortex file, try ezstart.
What is a sequence?
Each event during an experiment should have a corresponding event code. The simplest sequence is a list of event codes. When a trial has the same group of events as the sequence, the sequence is "matched" and that trial will be kept for further processing. A more complex sequence uses groups of events to make the match more likely. For example, the sequence [30-32]   will match these different trials including events:
30 40 50
31 40 50
32 40 50
Do I have to provide GlobalIgnore codes?
A GlobalIgnore list is needed if an event code occurs in between relevant codes in a sequence.
Why does MatOFF keep rejecting my Center (or Mark) code?
Center and Mark are not codes, but code groups. For example, if the sequence is    , you must use "center 3" to center on code 91. Code 91 is in the third code group. Why? Codes can always be listed as groups (see "what is a sequence"). If Center does not specify a whole group, then there might be some trials with no centering code. Every trial must have a centering code to align rasters, histograms, events, etc.
Every time I try Show MatOFF says "no trials found".
"No trials found" usually indicates a problem with the sequence or GlobalIgnore. Use the Read Events command a look closely at the order of the event codes. Make sure you have at least one trial that includes the sequence codes in proper order. Also, make sure you GlobalIgnore any events that interrupt the sequence codes on trials you would like selected. Try starting with a sequence of only three codes.
Spot does not work.
Unlike Center and Mark, Spot uses actual event code numbers. Also, Spot only works on events codes that are in the sequence.
The rasters run off the bottom of the page. How do I prevent that? Reduce the raster tic size and spacing. Set the raster position higher (smaller value). See the Raster command.
How do I shift everything on the plot to the left (backwards in time)?
Use the Shift command. A positive shift moves the display to the left.
The default layout puts the histogram above the rasters. Can I reverse this?
Decrease the Raster position value and increase the Histogram position value.
Can I put text labels on the plot?
Yes. Text can be placed on the plot using the Text command. Color, position, size, and angle can all be controlled.
Can I change the bin width of the histogram?
Yes, with the Binwidth command.
Can I put multiple plots on one drawing page?
Of course, but it is a bit tricky. Decide on the number of plots per page. Use the Axis multiplot command to set that number. Use the Axis subplot command to select which plot to draw next. The Show command will then plot at that location. See the Creating Plots (plotting.html) document page.
Can I put multiple histograms on one set of axes?
You can draw over any existing plot by using the Overplot command instead of the Show command.
I have the plot layout exactly the way I like, can I save this layout?
The Save command will generate a protocol file that can re-created all of the current settings. The plot setup is called a "layout." Layouts are treated separately from other MatOFF parameters (like the sequence). To save all parameters including the layout, use the "layout" option of the Save command. To save only the layout, use the "only" option of the Save command. There is another way to save the layout. The Layout save command will store all 10 layouts. What, you say? You did not know that there are 10 layouts! The Layout command selects which of the 10 layouts you are using at any moment. You can predefine a set of plot layouts and have them available for use any time. The Display command selects which layout will be used for the next plot. It is even possible to make multiple plots with one Show command by specifying a list with the Display command. See the Display command description for more details.
Is there an easy way to plot the same data in two different ways?
See the previous question. Can I order the rasters from highest activity to lowest activity? The rasters can be ordered using the Sort command. Sort epoch and Sort pulse are two different ways to order the rasters based on firing rate. Protocol Files What are protocol files? MatOFF has about 100 commands, not counting all the options and variants. When you use the menus to control MatOFF, the menus translate each mouse click into a MatOFF command. Likewise, the commands update the menus. The commands and menus can be used interchangeably. A protocol file is simply a list of MatOFF commands. You can use protocol files to execute a group of commands that you use often. You can also make large protocol files to batch process large data sets. There are some special features of protocol files to help with large data sets.
The documentation is very involved. Is there an easier way to get started?
Protocol files are simply a collection of MatOFF commands. One easy way to get started is to generate a plot with your data using typed commands or the menus. Then, use the Save command. The Save command generates a file of MatOFF commands that you can study for writing your own protocol files.
Is there a GOTO or FOR loop?
There are no branch or loop instructions. However, metafiles can operate as subroutines.
Are there variables?
The PCOFF command can be used to set up variables that a protocol file uses. Also, metafiles can be called using variables.
What is the difference between protocol files and metafiles?
Metafiles and protocol files are the same, with just a few exceptions:
1) A metafile can be called just using it's name with no extension. This is a handy way to create your own MatOFF command.
2) Metafiles recognize both types of variables ($1, $2,... and %1, %2,...).
3) Protocol files can call metafiles, but not the other way around. That is, metafiles are essentially subroutines.
Debugging protocol files.
There are a number of techniques that help debugging protocol files. To locate the offending section of the protocol file:
1) You can insert the Break command in the protocol file at various points to help locate the problem.
2) The ErrorLevel command can turn on and off detailed debugging information.
3) Use the Log command to save all debugging information to disk.