channel 1
Chair (Coordinator) and Rapporteur: SIMONE CACACE
Lecturers
Objectives
General goals: to acquire computer programming skills in MATLAB, which is one of the most used languages in numerical calculation, and to apply the acquired computer skills to the resolution of some mathematical problems and for the graphics of data and functions.
Specific goals:
Knowledge and comprehension: students who have passed the exam will be able to implement simple algorithms and create graphs using MATLAB software.
Apply knowledge and comprehension: students will be able to develop codes in the MATLAB environment to solve numerical problems, using the main functions of MATLAB
Critical skills and judgment: students will have the basis for creating elementary mathematical algorithms and structuring through vectorization, which proves to be optimal in the MATLAB environment from the point of view of computational efficiency.
Learning skills: the knowledge acquired will allow students to study of problems that require scientific programming skills and will certainly facilitate them in learning other software of interest for scientific calculation and for future work.
Learning outcomes
The course aims at acquiring skills for the computer implementation of high-level programs in the interpreted language MATLAB (MATrix LABoratory), including its fundamental constructs and their application to use cases related to scientific computing, data processing and advanced graphical display of calculation results.
Prerequisites
Basic knowledge of the typical constructs of programming languages, relational and logical operators, flow control, loop control, elementary operations on vectors and matrices. Topics covered in the courses of Programming and Calculus Laboratory and Linear Algebra.
Programme
Matlab Desktop components and their organization, workspace, command window, command history, online documentation, window layout, preferences, script editor, array editor.
Workspace manipulation, loading and saving data to .mat files, loading and saving scripts to .m files.
Strings, scalars, constants, math functions, vectors, matrices. Variable assignment, arithmetic operations, concatenation, transposition, length and size, element-wise operations, access/modification/deletion of elements and blocks of elements, predefined useful matrices, creation, manipulation and more advanced operations on vectors and matrices.
Relational and logical operators in scalar, vector and matrix form.
Flow control and loop control.
Anonymous functions, primary functions, global variables, secondary workspaces.
Graphics components, object hierarchy, object handles, reading/writing/finding object properties. Main properties of figure, axes, line, surface, image objects. Visualization of points and graphs in the plane and in the space, functions of one and two variables, parametric curves and surfaces, vector fields, contour lines, modification of color properties, style, markers via handles. Color maps, lights, lighting and texture mapping. Time measurement, animations in real time.
Interactive uicontrol components: buttons, sliders, text fields, popup menus. Behavior of the uicontrols through customized functions and creation of graphical interfaces.
Books
Matlab online documentation, official guide in pdf format, lecture notes and scripts.
Further readingsi:
- Cleve Moler, Numerical Computing with Matlab, SIAM, 2004
- Peter I. Kattan, Matlab for beginners. A gentle approach, Createspace, 2008
Bibliography
Matlab online documentation, official guide in pdf format, lecture notes and scripts.
Further readingsi:
- Cleve Moler, Numerical Computing with Matlab, SIAM, 2004
- Peter I. Kattan, Matlab for beginners. A gentle approach, Createspace, 2008
Lessons mode
The course takes place entirely in the laboratory and provides for continuous interaction between the teacher and the students. Each student occupies a workstation equipped with a computer and, as new concepts/tools are introduced, there is a direct implementation of code aimed at understanding and faster use of the same.
Frequency
Attendance is not mandatory but strongly recommended
Exam mode
The exam takes place in the laboratory (max 3 hours) and consists of a practical test, i.e. the creation of a MATLAB script on a theme that will be assigned at the beginning of the test itself, similar to those presented during the course.
Example exam questions
Implementation of a blur filter for images.
1. Load an image, i.e. a matrix with RGB values (triplets of unsigned uint8 integers)
2. Separate the three components into 3 matrices R, G, B with real values (double)
3. Modify the three matrices using the following relationship:
M(i,j)=M(i,j)+alpha*( M(i-1,j)+M(i+1,j)+M(i,j-1)+M(i,j+ 1)-4*M(i,j) )
with M=R,G,B and alpha a parameter in (0,1/2)
4. Convert the three arrays back to uint8 values and reassign them to the starting image object
5. Add a slidebar that adjusts alpha between 0 and 1/2
6. Add a button (push) that resets the current image to the initial one
7. Add a button (push) that performs a single matrix update step
Arguments
- -
- Academic year2024/2025
- Degree program to which the course belongsMathematics
- Lesson codeAAF1299
- Year and semester2nd year - 1st semester
- Activity typeUlteriori attività formative (art.10, comma 5, lettera d)
- Academic areaAbilità informatiche e telematiche
- Mandatory presenceNo
- Languageita
- CFU3 CFU
- Total duration36 hours
- Hours distribution36 training hours