in Software Development

A dot can make all the difference

In my recent post on resistance, one of the quirks in the work tool (GNU Octave/Matlab) was trying to understand matrix math in a Matlab script. I wrote to the script author and gave my interpretation of the script, and the author said I was correct. When I tried to compare with my C language implementation, I got different results. What I discovered was that if it was “A * B”, that was regular matrix multiplication. However, if it was “A .* B”, THAT was element-wise matrix multiplication (totally different result). I tracked down some pages on the MathWorks website, then brought it up with the script author, who acknowledged he did not tell me about that…ugh. One of Julia Evans’ recent comics on debugging was a great help – thanks Julia!

Write a Comment

Comment