# - preliminary program

### 1. Introduction to Matlab

#### Tue 30.11.2010, 09.00-18.00, W2-2-224

How to program with Matlab?

Skript:  pdf-Version: IntroductionMatlab1.pdf  Word-Version: IntroductionMatlab1.docx (both Versions are identical)

Demo programs: vectors_and_matrices.m, matrix_mathematics.m

Demo data: picturematrix.mat (homework 2e) , demo_data.mat (homework 2f and 2g)

Course examples of homework solutions: homework_Day1_2.zip

Topics:

• Matlab windows
• Help
• Variables
• Basic syntax rules
• Error messages
• Vectors and matrices
• Mathematical operations
• Some build-in mathematical functions
• Basic graphics
• Scripts

#### Tue 14.12.2010, 09.00-18.00, W2-2-224

Functions, data types and if statements

Skript:  pdf-Version: IntroductionMatlab2.pdf  Word-Version: IntroductionMatlab2.docx (both Versions are identical)

Demo programs: if_demo.m, aliasing_effect.m

Demo data: data_for_day2.zip

Course examples of homework solutions:  Homework_Day2.zip

Topics:

• Functions
• Well-structured programs
• Numerical data types: double, integer
• Characters
• Logicals
• Casting
• Tests for types and equality
• if statements
• Statistical significance test

#### Thu 16.12.2010, 09.00-18.00, W2-2-224

Loops

Skript:  pdf-Version: IntroductionMatlab3.docx  Word-Version: IntroductionMatlab3.pdf(both Versions are identical)

Demo programs: demo_programs_for_day3.zip

Demo data: data_for_day3.zip

Course examples of homework solutions:  Homework_day3.zip

Topics:

• for loops
• while loops
• nested loops
• searching in data
• sorting data

#### Tuesday, 11.1.2011, 9.00-12.00 in W2-2-224

Meeting to discuss homeworks of day 2 and day 3

### 2. Matlab - advanced topics

#### Wed 12.01.2011, 08.30-10.00, W3-1-152

Data flow and control flow

Topics:

• Software development
• How to structure a big problem
• Control flow
• Pseudocode
• Flowchart
• Data flow
• Data flow diagram
• Control elements in programs
• if-construction
• switch construction
• for loop
• while loop
• Scripts and functions
• scripts
• functions
• sub-functions
• nested functions
• global variables

#### Thu 13.01.2011, 08.30-10.00, W3-1-152

Error handling

Demo programs: debugging_example.zip

Topics:

• Testing a program
• Debugging
• Debugging by hand
• Using the debugger
• Even more advanced tools for debugging
• Common sources of errors
• Unexpected user inputs
• Case distinctions
• Random numbers
• Directories or file names
• Using the cell mode in the editor

#### Wed 19.01.2011, 08.30-10.00, W3-1-152

Peter Harmand: Comparison of Matlab statistics toolbox and R

Skript and demo programs: scripts_and_data.zip

Topics:

• Basic statistics with Matlab and R -- a comparison
• The programs and the user interface
• Data input
• Multivariate data sets
• Statistical graphics
• Probability distributions
• Test etc.
• Programming
• Some statistics around the Poisson process and spike trains
• Review/crash course: What is a Poisson process?
• Simulation of Poisson processes
• Various ways of testing Poisson processes
• Inhomogeneous Poisson processes
• Modifications to simulate a refractory period
• Comparison with real data

#### Thu 20.01.2011, 08.30-10.00, W3-1-152

Speeding up

Demo programs: updown.zip

Topics:

• Memory management
• How Matlab uses memory
• Tips to save memory
• Sparse matrices
• Computing time management
• Initialize variables
• Vectorized solutions
• JIT-Accelerator
• Built-in functions
• Tips to save CPU time
• Tools to improve the performance
• Time watch
• CPU time
• debugging tools
• profiler
• Matlab and C
• MEX files
• Matlab Engine
• Matlab Compiler
• Example for speeding up Matlab code and using the profiler (see updown.zip)

#### Thu 27.01.2011, 08.30-10.00, W3-1-152

Demo programs: struct_cells.zip

Topics:

• Basic data types (see script IntroductionMatlab2.pdf)
• Logical indexing
• Cell arrays
• Structures
• Functions with variable numbers of input and output arguments

#### Thu 03.02.2011, 08.30-10.00, W3-1-152

Object oriented programming

Demo programs:  objects.zip

• General ideas of object oriented programming
• Nomenclature
• Definition of a class
• properties
• methods
• Creating class hierarchies
• Handle classes and value classes

#### Thu 10.02.2011, 08.30-10.00, W3-1-152

Graphics

Demo programs: handle_objects.zip graphics.zip

• General considerations
• Creating graphics with Matlab GUIs
• Matlab graphics objects hierarchy
• handle graphics
• Manipulation of graphics objects
• handles
• current objects
• get and set properties
• property names
• Graphic objects hierarchy
• figure
• axes
• core objects
• plot objects
• group objects
• Axes and multiple figures
• figure windows
• multiple figures in one window
• modify properties of current axes
• 2D plotting
• plot command
• more plotting commands
• line specifiers
• 3D plotting
• line plotting
• surface plotting
• Text in figures
• Exporting figures
• Graphics callbacks

### 3. Matlab - Projects

#### Mon 28.2.2011, 09.00-12.00, W3-1-152

Anne Schlüter, Sabine Hochmuth, Lena Rehn

#### Mon 7.3.2011, 09.00-12.00, W3-1-152

Friederice Pirschel, Lena Köpcke, Julia Furche