# Katedra teoretické elektrotechniky

## Matlab Course Regensburg Part I

Published on 8.2.2016 by

# MATLAB and computer simulations course for students of HS Regensburg

13. 2. – 18. 2. 2017

Guaranty:  Prof. Ing. Zdeňka Benešová, CSc, University of West Bohemia in Pilsen, Prof. Dr.Ing. Roland Schiek, FH Regensburg,  Prof. Dr. Ing. Rainer Haller

Lecturers: Assoc. Prof. Václav Kotlan, Ph.D., Ing. Tomáš Nazarčík

## Monday

1. Opening of course   8:30 – 8:45
2. MATLAB basic   (Kotlan)   8:45 – 10:15

• Environment basics – introduction, window environment, interpret style, menu system
Basic declarations – case sensitivity and basic working rules
Command Window, Workspace, History – properties, working with windows
Help Style, using help declarations with concrete commands
MATLAB programming language and basic commands (use in linear algebra, square matrixes, elementary functions and basic operations with vectors)
Brackets (square, angle), parentheses. Semicolons and commas – meaning and usage.
Matrix principles in MATLAB language (declarations and using with examples)
Matrix algebra (some functions), using “dot-operators” (like A.*B or A.’)
Selected helpful functions from help chapters elmat and elfun (like atan, angle, pascal, magic, det, inv, diag, sort, sum, min, max, size, etc.)
Matrixes with complex numbers (examples and functions)System of linear equations – solving (using matrix operations – examples)
Further functions – goniometrical functions, integral (quad), sorting.
1. Basic graphical functions – graphs and figures     (Nazarčík)   10:30 – 12:00
• M-files editor – basic functions (menu system, open, close, trace, name …)
Creating of basic MATLAB scripts (basic graphical output of a simple function, grid, plot(x, y), points, colours, axes, labels, title, scalling, etc.)
Functions with polynomial arguments (polyfun, polyval, etc.)
Curve fitting – linear, polynomial and spline regression, graphical output (functions polyfit and interp)
1. MATLAB programming   (Nazarčík)   13:15 – 14:45
• Flow control statements – loops (for, while), conditions (if, switch-case), etc. Editing m-files – creating functions (examples – cumulative integral and equation solving, user data input)
Possible training, questions, discussion
Flow control statements – loops (for, while), conditions (if, switch-case), etc.
Editing m-files – creating functions (examples – cumulative integral and equation solving, user data input)
• Possible training, questions, discussion
1. Advanced functions and practising (Kotlan)   15:00 – 16:30
• Interactive input / output commands, user defined error messages, commentary (functions input, error, msgbox)
• Further functions –  integration (integral, trapz, cumtrapz), sorting, etc.

## Tuesday

examples from the morning

1. ODE functions application  (Kotlan, Nazarčík)   8:30 – 10:00
• ODE-functions – solving of first order ordinary differential equations, system of differential equations, higher orders differential equations.
• Examples of simple transient phenomena – RC, RL circuit etc.
1. ODE functions application  –  continue (Kotlan)   10:15 – 12:00
• Solving problems using ODE solver, creating own application.

examples of ode functions

1. Introduction to 3D graphs   (Kotlan)   13:15 – 14:45
• meshgrid, mesh, surf, surfl, colormap, shading, interp.
• Examples of 3D functions (functions depended on two variables).
• 3D curve – Line Plots of 3-D Data (plot3), examples. Exporting graphs to file, setting graphical formats (fig, png, tif etc.)
1. MATLAB – graphics, GUI and multimedia   (Nazarčík)   15:00 – 16:30
• Advanced settings of graphical objects.
• Graphical user interface – predefined dialog boxes, advanced settings.
• Creating animated sequences (movies and animated graphics), audio-video functions (VideoWriter).
• Practicing, standalone working on given tasks with the help of lecturers, students questions.

## Wednesday

1. Fourier transfomation – FFT (example, harmonic signal analysis – noised input signal) (Nazarčík)   8:30 – 09:15
2. Autonomous working on more extensive example, working with complex numbers, applying ODE functions, dialog boxes, graphical interface, animations (with help of lecturers)   (Kotlan, Nazarčík9:30 – 10:15
3. MATLAB test  (Kotlan, Nazarčík)   10:30 – 11:30
4. Results of MATLAB test  13:30 –13:45