MRES Exercise #9 Getting Started with MATLAB

This exercise helps students to get started with MATLAB. During the first part, the students are asked to go through the 2–3 online tutorial “MATLAB Onramp”, available online at the MATLAB Academy to get familiar with the MATLAB fundamentals. Second, the students are asked to obtain information on a specific MATLAB function from the documentation. And third, the students are asked to create a simple MATLAB function.

Exercise “Getting started with MATLAB”

  1. Please go through the self-paced course “MATLAB Onramp” available online at the MATLAB Academy to get familiar with the MATLAB fundamentals. Upload the certificate issued at the end of the course to the MOODLE home work page (workload 2–3 hours).
  2. Search the MATLAB documentation for the function “findchangepts” and explain what it does. What are the input and output parameters? When was the function introduced in MATLAB (workload ~1 hour)?
  3. Create a MATLAB script that displays the string “Please enter the value of x …”, waits for the input of the value of x, and then calculates and displays the square of x in the Command Window (workload ~1 hour).

Solution “Getting started with MATLAB”

  1. Go through MATLAB Onramp provided online at the MATLAB Academy.
  2. The function finds abrupt changes in the mean, the standard deviation and the trend in a signal. Input is the time series x, output is the indices of the changes and the residual error of the signal against the modeled change. The function was introduced with release R2016a.
  3. Solution:
x = input('Please enter the value of x ...');
y = x^2