Programación
Busca apuntes, exámenes y más
Resumen con todos los comandos útiles para realizar los ejercicios y hacerlos bien
Apuntes con toda la teoría de informática, no la olvides que también entra en el examen y te puede salvar.
Exam simulation in English with the solutions written out: the reactor filling problem asking for the calcConcentration function from the flow rate and the inflow concentration, taking into account the volume of liquid and the amount of particles in it, p
Complete exercise sheet in English: reason about what will happen in the described situation, draw the flowchart of the functions that compute the position array, and write the two controllers that decide the driving direction from the cross track error.
Function that computes the final concentration of benzene in a reactor from the inflow concentration, the pumped volumetric flow rate, the elapsed time and the initial volume and concentration, with a full header documenting every input and its units.
Script that takes the Fahrenheit temperature series of the dataset, converts it with the tempF2C function, and carries on with the analysis and the plots asked for in the assignment, commented step by step.
Full weekly assignment sheet in English: continuing the introduction to the MATLAB environment, syntax and operators, plotting, and the difference between a script and a function and when to use each. Includes the learning goals, the background knowledge
Function that returns the driving direction with a proportional controller: the sign of the cross track error multiplied by its absolute value and by the gain P, so the correction grows with the distance to the desired line. Comparar con la version bang b
Function that returns the driving direction using a bang bang controller: a fixed predefined angle whose sign comes from the cross track error, so the car always steers at full angle towards the desired line.
Solved exercise from lab session 3: the program reads two integer numbers with input, compares them with an if, an elseif and a final branch, and displays which one is the largest, also handling the case where both are equal. Commented line by line.
Unit 5 slides: MATLAB data types revisited, what a structure is, how to define and access its fields, vectors of structures and how to run through them. 23 slides in English.
Unit 4 slides: structured versus simple data types, the concept of array, how to declare and initialise one, indexing, reading and displaying elements, operations with vectors and matrices and the most useful built-in functions. 52 slides.
Collection of sample test questions with the right answer marked: what a script prints, nested loops with mod, while loops counting backwards and the rest of the classic traps. 3 pages.
Long exercise of the ordinary exam: the pollutionMatrix with the daily nitrogen dioxide levels of 2019, the knowCriticalMonths function and the rest of the sections with their headers. 8 pages.
Extraordinary exam of June 2019 with the gymnastics scoring problem and its full solution: reading the marks, discarding the highest and the lowest and computing the final score. 5 pages.
Solved exercise: the program asks for the price and the money given, computes the change working in cents and prints how many coins of each type to return, from 1 cent to 2 euros. 2 pages commented.
Solved exercise: the 3-D matrix hours for eight employees, five days and two factories is initialised at random, and the totals per employee, per day and per factory are computed. Commented step by step.