Busca apuntes, exámenes y más

Todo
Apuntes
Ejercicios
Exámenes
Otros
chevron_left
chevron_right

Photo of the basic version of the third mid term: reading a text file, asking the user for a number, selecting the records that meet each criterion in order of priority and writing the chosen ones into a new file. With the full example of execution.

1 página

Photo of the advanced version of the third mid term: the program reads a second file with the identifiers of the available items and their number of units, assigns them in the order they appear, and writes the result into the output file. With the example

1 página

Photo of the full second mid term exam paper with the three exercises and their marks: writing a function that inserts words into a sentence at given positions, the variant that inserts them after the given words, and the version with a fourth parameter.

1 página

Second version of the function that inserts words into a sentence at given positions, splitting the sentence into parts according to the positions vector and concatenating everything, commented step by step.

1 página

One page listing the most commonly used MATLAB functions for working with strings, each one with the meaning of its arguments and what it returns: comparison, search, replacement, splitting, case conversion and trimming.

1 página

Complete review booklet for the final exam of the 2020-21 course, with every exercise fully solved: strings, cell arrays, vectors of structures, files, recursion and the search and sort algorithms, with a content table at the front.

140 páginas

Exercises part of the January 2012 exam: the findWord function that reads a file and looks for a word, and the other problems with their marks. 5 pages in English.

5 páginas

Exercises part of the January 2011 exam: the copydata function that builds a new vector from an existing one, and the rest of the problems with their marks. 3 pages in English.

3 páginas

Function that receives a vector of values and prints on screen how many times each different value appears, with the example of execution showing the expected output.

1 página

Function that receives a string and prints the sentence with each of its words spelled backwards, keeping the words in the same order, with the example A cat is an animal.

1 página

Function that receives a vector of integers and returns it without repeated numbers, with the sorting part of the exercise included.

1 página

Function that searches for occurrences of one string inside another and replaces them by a third string, with the worked example of turning the into test in a sentence.

1 página

Short script that sets a sample sentence, the words to insert and the vector of positions, and calls addTexts2 so the result can be checked.

1 página

Recursive function that proves Ulam conjecture: halve the number when it is even, multiply by three and add one when it is odd, until reaching 1, with the program that asks the user for the starting number.

1 página

Function that runs through a vector of structures and returns the indexes of the records whose numeric field is above seventy, building the result vector index by index.

1 página

Function that runs through a vector of structures and returns the indexes of the records whose field matches the value looked for, using strcmpi so case does not matter.

1 página

Recursive function that transforms a number from base ten to any other base, with the main program that asks the user for the number and the new base and prints the result.

1 página

Full solution of the third midterm: opening the file with fopen and checking the identifier, reading each record into a vector of structures, running the searches and writing the output file. 2 pages commented for readability.

2 páginas

Script that guesses the number the user is thinking of by halving the interval on each try, counting how many questions it needed. A clean example of binary search.

1 página

The myReplace exercise with its full statement, the example of execution and the solution, useful to see how the result should look before writing the code.

1 página