Some useful matlab stuff