Visualizing running routes with Matlab and garmin-connect-export

Introduction

I’ve had a Garmin running watch (Forerunner 620, great watch!) for quite a while and ran a lot with that watch. Sadly, Garmin Connect is lacking an “export all” feature for your runs. We will use garmin-connect-export to download all our runs and visualize them with Matlab to obtain a heatmap-like summary of the most frequent routes we’ve been running.

Continue reading “Visualizing running routes with Matlab and garmin-connect-export”

On colormaps

Problems with the (old) standard colormap in Matlab are widely known. Even MathWorks addressed this issue after changing the default colormap in this blog post. But there are several other sources that discuss this issue or provide better colormaps. Most of them just a short Google search away (e.g. here, here or here).

The de facto standard source for good colormaps is ColorBrewer developed by Cynthia Brewerbased on the research of Dr. Cynthia Brewer. To use these maps in Matlab, you can use BrewerMap by DrosteEffect.

To summarize some of the different colormaps, I chose some typical numerical results that I often have to visualize. These are visualized with different ColorBrewer maps, as well as with jet for comparison.

The first example is the checkerboard test case. A source is placed in the middle of the domain and emits radiation in a heterogeneous environment. As for all further pictures: everything is the same but the colormap. The checkerboard results are shown below.

Continue reading “On colormaps”

Fizzbuzz with two if-statements

What’s fizzbuzz?

According to http://wiki.c2.com/?FizzBuzzTest

The “Fizz-Buzz test” is an interview question designed to help filter out the 99.5% of programming job candidates who can’t seem to program their way out of a wet paper bag. The text of the programming assignment is as follows:
“Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.”

Everyone who knows to program a little bit can solve this problem.
However, there is something in there that makes the naive solution seem to be a bit ugly and I always wanted to find a way to overcome this. That is, to write the naive code, one would check for divisibility by 3 and divisibility by 5. To check divisibility by 15, one could use the flags obtained by the previous checks or make a new check for divisibility by 15.

Continue reading “Fizzbuzz with two if-statements”