Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Homework

Ideally, do this exercise on a computer on which Matlab or octave are installed.


More information on how install these software are on mathworks.com or on gnu.org/software/octave

Don't forget to properly configure `git` with your username and email as explained in the training slides.

Detailed instructions

  • First, fork the https://git-r3lab.uni.lu/R3school/git.practice repository.

  • Create the new branch homework_myName.

  • Implement a new function (create a new file sqrt_myName.m in a new folder src/thirdCommit) called sqrt_myName(x) that computes the square root of x.

  • Rename the test.m file in the test/suite directory to test_myName.m.

  • Edit the file test.m and change the names of the functions accordingly.

  • Before submitting the merge request, verify locally that your code is running properly.

    To do so, open the MATLAB application and type matlabroot. This will return the path to the MATLAB application. Note or copy this path and exit MATLAB. NOTE: Do not copy the apostrophes, as they just denote the returned string.

    Open the Terminal and execute the following command:

    $ matlabroot/bin/matlab -nodesktop -nosplash < test_testAll.m

    and verify that no error is reported. NOTE: matlabrootin the terminal window refers to the copied path from the previous instruction.

  • Create a merge-request.

  • Assign @laurent.heirendt and your merge-request will be reviewed.


That's it!