BtM 2018, Week 12

In Week 12, we are starting to focus on getting student projects underway. Our lab session on Thursday will not be dedicated to a new lab, but to your projects… and, if you need, an opportunity to finish up any late labs. Meanwhile, the instruction part will talk about the tools you need to set up your own environment, both for the project and your future individual work.

Note:

  • The deadline for Lab 11 is Thursday, Nov 15.
  • No labs will be accepted, even late, by Andrew (TA) after November 30.

Documents for download:

 

 

BtM 2018, Week 11

Hi BtM students – week 11 is here! Our topic is errors, bugs, mistakes: How to find them in your code, and how to avoid them.

The slides are here. And the sample code we played with in class is here.

As for this week’s lab, it consists in finding 10 errors in a pice of MATLAB code, and answering one question. The code file is here. It calculates Fibonacci numbers, and the ratio of successive numbers, which converge towards the golden ratio (1.61803…). The intended output is this plot:

As for your task:

  • Make a clean (untouched) copy of your code file first, before working on it. The code won’t even run until you’ve found and corrected the syntax and runtime errors.
  • There are 10 errors in it. For each, you need to provide the line, the error message (if there is one) and the type (syntax error, runtime error or logical error).
  • Look at the help MATLAB gives you – red and orange bars at the right edge.
  • In addition to the debugging, you are also to use the debugger to find out the value of the variable ii on the second iteration of the for-loop. For this, you need to set a break point at the beginning of the loop, and then use the “step” button to proceed step-by-step. Keep an eye in how ii changes. The second value of ii is what you are asked to find. Before tackling this task, you’ll have to have found the first two errors, otherwise you can’t run the loop! (If you still have trouble, you can, in a copy of the file, delete or comment out what comes after the loop so that errors in this part don’t prevent you from running it.)

BtM 2018, Week 10

More Unix/Linux shell, and some introduction to shell scripting!

Reading:

BtM 2018, Week 9

(Note: Week 7 had a double dose of lecture, while week 8 had two labs. Back to normal in week 9.)

This week’s goals:

  • What is an operating system (OS)? What is Unix/a Unix-like OS and why would we want to use it?
  • *ix history and philosophy
  • Get your own virtual Linux computer!
  • Elementary Unix/Linux command line.

Documents for this week:

BtM 2018, Week 7

A small schedule change this week!

 

  • Tuesday will be class as usual.
  • Thursday   we will have class, not lab, taught by me (Chris). We will proceed more deeply into plots with MATLAB: plotting rasters, images and, finally, maps, as well as outstanding small topics I haven’t mentioned. I’ll also reserve the last 30 min for question hour in which you can ask about any open issues you have with labs.
  • Next Tuesday we will have Lab 07 (taught by Andrew), which is about plotting. It will be a very guided step-by-step lab in which you apply the topics from this (last) Tuesday: creating a scientific plot, changing colors, fonts, other properties, to create a publication-ready result.
  • Next Thursday we will have Lab 08 (taught by Andrew), which will be a review lab to give you the opportunity to practice MATLAB coding going back to the very first steps (variables, operators, if-statements, loops).
    I’ll be back the week after.

 

The slides are here (one document for both parts).

Also a brand new repository for this week:  https://github.alaska.edu/Fall2018-BtM/Class_Lab07

  1. Go to the URL
  2. Click “Fork””
  3. Open GitHub Desktop
  4. File> Clone Repository
  5. “Enterprise”… log in …. select “Class_Lab07”

BtM 2018, Week 6

Hi students! Week 6 takes us back to MATLAB coding. The big topic is: How to get data into MATLAB and write it back out.

The basic steps in many scientific data processing task are:

  1. Load data
  2. Transform, clean and/or process data
  3. Write cleaned data out to a new file

The material for this week is here”

BtM2018, Week 5

Week 5 will be different from weeks 1-4. We’re taking a small break from programming and taking a wider look at the environment in which we write code and organize our files. The big topic is version control and project organization.

  • Download slides as PDF.
  • Make sure to review at the videos posted in week 3!
  • BEFORE STARTING THE LAB: You need to make sure you can log into the UA Enterprise GitHub and have GitHub Desktop installed. Instructions are in the slides You can do this before starting the lab. If you can’t log in, see your instructor or TA right away.
  • The lab instructions are on the UA Enterprise GitHub here: https://github.alaska.edu/Fall2018-BtM/Lab05/

Extra reading:

BtM 2018, Week 3

Week three will be largely dedicated to getting a lot of practice with what we’ve learned so far:

  1. Practice with vectors and other variables
  2. Practice writing functions
  3. Practice reading code and making small changes
  4. … and a main topic: conditional statements (if-elseif-else-end and switch-case-otherwise-end)

Things to do:

In addition  we’ll also be preparing to look at how code files are organized. One key tool to help programmers organize and manage their code is a  version control system (VCS).  VCSs also help share code and collaborate via web-based  repositories.  A popular VCS is called git, and a popular online repository site is Github. UAF has its own internal enterprise installation of Github, which we can use just like the public free Github site, but without having to share our code with the rest of the world.

To prepare, here are two things you can do:

  • Try to log in at the UA Github  with your UAlaska credentials.
  • Watch the following 5 min video:

 

Confused? Never heard of such a thing before? Want a more gentle intro? I like this one too (14 min).