setting default parameters for m@cortex operation

Several default settings that apply to different aspects of m@cortex operation are stored in a text file named 'giucode.def'. The file normally resides in the 'giucode' directory, but it can be placed anywhere, as long as its path is available to Matlab.

The distribution giucode.def is commented in a way that should make the file self-explanatory (otherwise please let me know).

Other than by directly looking into giucode.def, you can inspect default parameters with

>> getdefs

which returns a structure containing all default parameters. You can also access specific subsets of values by doing, for example:

>> getdefs('cortex')

which results in a structure containing all default parameters belonging to the [cortex] section. Note that getdefs is only intended to inspect values, i.e. you cannot change defaults by changing the structure returned by getdefs.

In order to change default settings, you must edit and save giucode.def, and then run the following at the command line:

>> readefs

Any subsequent activity will use the new settings, and this is all there is to know for basic operation. The following, however, may be useful for a more advanced usage.


The script readefs.m reads and parses the file giucode.def, putting all settings in a structure, whose name is GiuCoDefaultValues (case sensitive).

GiuCoDefaultValues is declared global, which makes it potentially accessible from any script or function anywhere in Matlab. I chose a long, awkward variable name to prevent inadvertent overwriting of the structure.

One disadvantage of storing defaults in a text file is that it needs to be manually edited if changes are to be applied. This makes it impossible to quickly change values during , for example, the execution of a script. There is a way around, though.

The following declaration:

>> global GiuCoDefaultValues;

(at the command line or within a script) makes the structure freely available to any workspace. It is then possible to directly change values, e.g.

>> GiuCoDefaultValues.spikes.data_on_off = [18 19];

The new parameters are immediately available to any subsequent operation. Keep in mind, however, that since 'giucode.def' is unchanged by this manipulation, any changes applied directly to the structure are lost when GiuCoDefaultValues is destroyed (e.g., when Matlab is restarted).