Matrix is a BBC Books original novel written by Mike Tucker and Robert Perry and based on the long-running British science fiction television series Doctor Who.
It features the Seventh Doctor and Ace. It also includes appearances by the Wandering Jew and Jack the Ripper. Part of it is set in an alternate timeline, featuring parallel universe versions of Ian Chesterton and Barbara Wright. The villain is the Valeyard.
Perry and Tucker originally pitched Matrix as a Virgin New Adventure, but were advised by range editor Rebecca Levene that the idea was unworkable.
As well as the obvious references to Trial of a Time Lord and the First Doctor's era, the Valeyard's schemes bring the Doctor face-to-face with dark alternate versions of his other selves who have been corrupted by the Valeyard; these include a First Doctor who murdered other Time Lords to depart Gallifrey in the first place, a Fourth Doctor who destroyed the Daleks at their beginning (Genesis of the Daleks) and a Fifth Doctor who allowed Peri to die while taking the antitoxin for himself (The Caves of Androzani).
Notably, this book came out roughly a year before the science fiction film The Matrix.