Table of Contents

Matlab - introduction

Given that NeuroElf is a Matlab toolbox with several features only available via the command line (at present at least), I want to give a short overview of Matlab, its features and how the user may be able to make better use of the available functionality.

First of all, Matlab can be regarded as a development environment with features such as a built-in GUI to inspect the current state (variables in the present workspace and their contents), editor with syntax highlighting, a debugging mechanism to run code step-by-step, and a powerful command line prompt.

But Matlab also comes with its own language (which shares many concepts, syntax elements, and features with other languages), and I want to highlight some of the most important features:

Language features

Built-in functionality

On top of these features, Matlab comes with many, many built-in functions from a variety of fields, among them are

These features make it usually relatively efficient to create code with complex functionality with just a few lines of code.

User-provided toolboxes

Mathworks additionally provides a user-defined toolbox area on their webserver, File Exchange, where users can upload their functions (or sets of functions, called toolboxes) which often allows users to solve even complex problems with a minimal effort, given that someone has already solved it before.

GUI elements

When Matlab is started (in its default configuration), the following “windows” (components) are available:

Additionally, Matlab comes with a built-in Editor, supporting syntax highlighting and augmenting several of the core features of Matlab, as well as a Profiler, a tool to identify bottlenecks in code, i.e. a help to improve the run-time properties (time and memory consumption) of user-written code.

Command line

The command line allows the user to enter commands and inspect returned values (text output intermixed with input). Matlab shows a prompt (>>) during normal operation and an extended prompt for debugging (K>>). The command line offers a few additional functions which are extremely helpful:

Command history

The history window is particularly useful when a series of commands is to be converted into an M-file (batch of function file grouping a set of commands/function calls into a new functionality). This can be achieved by selecting several entries (line by line selection) and then using the context menu (right-click or CTRL-click). To quickly repeat one specific instruction, an entry can also be double-clicked.

Workspace

Equally, the workspace window offers a context menu, which allows to rename variables, delete them from the workspace (same as clear VARIABLE), save the content of selected variables to disk, or alter their content.

Current folder

The current folder window is a feature-rich file browser, also with additional functionality in the context menu.