matlab: log only during switch depression