Professional Documents
Culture Documents
101827-FS2017-0: Programming With MATLAB: Advanced Course: Felix Wichmann
101827-FS2017-0: Programming With MATLAB: Advanced Course: Felix Wichmann
101827-FS2017-0: Programming With MATLAB: Advanced Course: Felix Wichmann
MATLAB supports two more advanced data formats: struct and cell
(a few more in recent years; we may come back to them in seminar no. 6).
3
Essential functions and concepts for today (cont’d)
Functions that are useful to know are:
- conversion functions like cell2mat, mat2cell, cell2struct
- as well as functions for quickly applying function to all entries of a struct
or cell (cellfun, structfun).
4
Detailed instructions for this morning
0. If you feel like a refresher: Watch the following (quick and dense!) video
tutorials on software-carpentry.org
(http://swcarpentry.github.io/v4/matlab/index.html) and have a
look at: Introduction, Basics, Indexing, Basic Flow Control and More Flow
Control
1. Flow Control: for versus while. Please have a look at the script
DiceGame.m I have uploaded to ILIAS.
2. Read and work through MATLAB Programming/Arrays.pdf
3. Read and work through MATLAB Programming/Struct Arrays.pdf
4. Read and work through MATLAB Programming/Cell Arrays.pdf
5
Detailed instructions for this morning (cont’d)
5. Read and work through StructuresAndCellArrays-Excerpt.pdf—do not
worry if there are references to particular files or functions you do not
have.
6. Read and work through Strings_Cells_Structs-Excerpt.pdf
pp. 1–3: Repeat and extended treatment of functions to manipulate
strings
pp. 4–7: About cells; do not worry too long about cellfunctions on p. 7
pp. 7–11: More on string manipulation—please SKIP this part
pp. 11-14: About structs
Stop on p. 14 and do not read (or worry) about Containers.map
7. Watch Structures and Cell Arrays on software-carpentry.org:
http://swcarpentry.github.io/v4/matlab/cellarrays.html
6
Homework
Download 01-Struct-Cell_Exercises.pdf from ILIAS and do the exercises.
On Thursday the 22nd of May I upload the solutions for you to look at, and
compare your own answers to my solutions.