Matrix stabilization using differential equations