Computational Neuroscience

Datenanalyse mit Matlab - PhD course 2010/2011

- preliminary program

1. Introduction to Matlab

Only for participants without experience in programming or in Matlab

Lecture and exercises in the biology computer room. 

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
  • saving and loading data
  • 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

For all participants

Lecture. Participants should apply the topics to their individual programming projects.

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

Data flow and control flow

Skript:  pdf-Version: Matlab_adv1_dataflow.pdf
Word-Version (identical to pdf-Version): Matlab_adv1_dataflow.docx

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

Skript:  pdf-Version: Matlab_adv2_errorhandling.pdf
Word-Version (identical to pdf-Version):Matlab_adv2_errorhandling.docx

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
  • Create your own toolbox 

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

Skript:  pdf-Version: Matlab_adv4_speeding_up.pdf
Word-Version (identical to pdf-Version):Matlab_adv4_speeding_up.docx

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

Advanced data types

Skript:  pdf-Version: Matlab_adv5_data_types.pdf
Word-Version (identical to pdf-Version):Matlab_adv5_data_types.docx

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

Skript:  pdf-Version: Matlab_adv6_objects.pdf
Word-Version (identical to pdf-Version):Matlab_adv6_objects.docx

Demo programs:  objects.zip

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

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

Graphics

Skript:  pdf-Version: Matlab_adv7_graphics.pdf
Word-Version (identical to pdf-Version):Matlab_adv7_graphics.docx

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

For all participants

Seminar. Participants will present their individual programming 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