ELECTRONIC DATA PROCESSING
Second semester
Frequency Not mandatory
- 6 CFU
- 45 hours
- Italian
- Trieste
- Obbligatoria
- Oral Exam
- SSD SECS-S/06, INF/01
- Advanced concepts and skills
Structured into the following modules:
The main purposes of the course are the following: A first purpose of the course is to provide some tools for a systematic and scientific approach to programming in a numerical computing environment. The course also illustrates, by means of some examples, how to solve a mathematical model by programming in such a kind of environment. During the lectures, the Matlab programming language will be employed. The basics of object-oriented programming in Matlab will also be illustrated. KNOWLEDGE AND UNDERSTANDING Knowing the basics of programming in a numerical computing environment. Knowing the main rules to write a good program in a numerical computing environment and understanding how to use them. Understanding how to deal with a mathematical model of a problem in order to find its solutions in a numerical computing environment. APPLYING KNOWLEDGE AND UNDERSTANDING Analysing a simple problem, finding an appropriate mathematical model, building a problem-solving algorithm and translating this algorithm into an efficient program. Employing good programming rules. MAKING JUDGEMENTS Making an autonomous analysis of a simple problem and building an appropriate model to solve it. Making an autonomous translation of this analysis into an appropriate program. COMMUNICATION SKILLS Explaining the choices made and the steps followed to solve a problem in a numerical computing environment. LEARNING SKILLS Employing the acquired knowledge to learn additional and also more complex topics concerning the employment of mathematical model and how to solve them in a numerical computing environment.
Some examples presented in the course will be related to topics in mathematics and statistics illustrated in the fundamental courses.
A basic knowledge of programming and algorithm theory is required. Passing the exam of the preliminary course 'Elementi di Informatica' is mandatory to sit for the exam of this course.
a) Definition of algorithm. Definition of average-case and worst-case complexity. Complexity classes and the relationship between complexity and an algorithm's execution speed improvement. Sequential search and calculation of average-case and worst-case complexity. Finding the two smallest elements of an array and calculating the complexity of some algorithms. Sequential search in a sorted array and calculation of average-case and worst-case complexities. Binary search algorithm and its complexity. Selection sort and complexity calculation. Merging arrays and calculating its worst-case complexity. Recursion. b) Introduction to Matlab Matlab workspace. Variables and expressions. Mathematical operators. Arrays. Array operators. Strings and character arrays. Relational operators and expressions. Logical variables and expressions. Casting among variables. Main numerical functions. c) Matlab arrays Matlab arrays. Random arrays. Main functions and operations to define and to use arrays. Arrays as arguments of functions. Array operators. Logical arrays. Logical indexing. Main logical functions. Logical operators. Dot function. Using tic, toc and timeit to calculate execution speed. d) Matlab programming Matlab scripts. Functions input, fprintf, sprintf, display and disp. Functions save and load. Defining and calling functions. Function arguments and local variables. Scope and lifetime of local variables. Functions as commands. Global and persistent variables. Copy on write. Conditional statements. Main “is” functions. Loop statements. Vectorisation. Main functions to read and save images. Errors. Tracing, debugger e profiler. e) Character arrays and strings Characters arrays and strings. Main functions for string and character arrays. Casting between character arrays and strings. f) Cell arrays, structure variables, categorical arrays and tables Cell arrays, structure variables, categorical arrays and tables: definition and use. Comma-separated list. Main functions to cast variables. g) Matlab files Saving and loading workspace variables. Reading and writing text files. h) Funzioni avanzate in Matlab Variable number of arguments for functions. Nested functions. Anonymous functions. Functions handles. Function functions. Functions func2str e str2func, fplot, feval. Using timeit with anonymous functions. i) Recursion Definition of recursion. Comparing recursive and iterative algorithms. Recursive and iterative Fibonacci algorithms. l) Graphs and curve fitting Main plot functions. Curve fitting. m) Object-oriented programming in Matlab Fundamentals of object-oriented programming in Matlab.
Main texts: Matlab - A Practical Introduction to Programming and Problem Solving - Sixth Edition Stormy Attaway Butterworth-Heinemann ISBN 9780323917506 eBook ISBN: 9780323986113 For the algorithms part, lecturer's notes. Other useful documentation: Computer Programming with Matlab J. Michael Fitzpatrick and Ákos Lédeczi ISBN 9780615751139 Documentation available on the MathWorks website: https://www.mathworks.com Examples and other aids will be available on the Moodle web page of the course.
Theoretical lectures will be alternated with exercises in the PC Lab. Some notes, examples and exercises concerning the topics presented in the course can be found on the course webpage at moodle2.units.it.
The detailed course program will be available in the Moodle website.
Students are required to be prepared on the whole content of the course. Besides, they are required not only to memorise but to have a good comprehension of the course content as well. Student should also be able to use the concepts learned in the course.
The exam will be in oral and practical form. A PC will be available. The application of the notions presented in the course to some computing or programming problems, solving some exercises or applying theoretical concepts to some examples, with discussion, might be required, in order to verify the level of understanding.