Change dimension matrix