Monday, 29 November 2010

Octave in Snow Leopard

When I opened Octave on my Mac this morning, I realised I wasn't able to plot. Quite worrying. It was working before, so why is it not working now? The problem it turns out is that the upgrade to Snow Leopard (Mac OS 10.6) introduces some problems (64 vs 32 bits stuff apparently). This is mentioned on the Octave-Forge website and more precisely here.

Before you follow the instructions posted on this last website, it's probably a good idea to take some time to upgrade your version of Octave and Gnuplot (included in the Octave distribution).

Update 05/03/2012: I updated Octave to v3.4.0 and found that Gnuplot had the same problem. I followed the fix above but, this time, it didn't work.

What I do now is to resort to the OpenGL/FLTK package, with the line

graphics_toolkit('fltk')

at the Octave prompt.

Saturday, 27 November 2010

What this blog is about

Welcome to Comp Maths Central, my diary of the maths stuff I'm working on while traveling on the Central Line every morning and evening. Two hours on the tube is a lot of free time, especially when the Metro and the Evening Standard have zero content.

I spend my time doing mostly programming and playing with Mathematica, so that's what you're likely to come across here. But from time to time, I'm also working on serious maths results, which I might discuss if I have time.

One post a week - that's my target. Let's see if my schedule can beat that of TFL.

Dabbling in Mathematica 8

I've just updated my version of Mathematica to version 8, and I'm quite impressed. Lots of new commands and features, which I've been trying on two tube journeys so far. Here are a few I find interesting:

Speak["Some text"]

This one is from Mathematica 7 actually, but I had never seen it before. Use it to turn your computer into a slave repeater with something like

N[π,10]//ToString//Speak

Or better yet use it to program a Bingo game (to come).

CurrentImage[]

Get images from your computer camera and do real-time computations on them. Try for example

Dynamic[EdgeDetect[CurrentImage[]]]

Probability is my main subject, so I'm pleased to see that Mathematica has two new commands, Probability and NProbability, for computing the probability of all sorts of events and distributions.

Another function related to probability:

StableDistribution[type,α,β,μ,σ]

Finally. Stable distributions were available as part of an intermediary package called StableDistribution (see also here), but now it's built-in.

Last but not least,

TextRecognize[image]

will convert the text of an image into actual text. It's not full-proof, but it can be useful. Test it on some scanned paper you have and have your computer read it using

TextRecognize[image]//Speak

This is just a teaser of what I'm playing with now. I'll discuss more commands and features (e.g. free form programming) in future posts.