In this sceneof The Matrix Agent Smith tells Morpheus that there were multiple Matrixes, the first one being "perfect". There is reference to this throughout the trilogy and in the Animatrix and it is revealed that there was more than one "failed Matrix". So how many Matrixes were there? I'm aware that an exact number probably isn't divulged but what conclusion can we draw from the evidence given?
There were the two Beta Matrixes and then Neo lives in the 6th cycle of the Matrix 1.0.
Now it depends if you count those as one Matrix or as 6, making the answer either 3 or 8.
The Architect explains that, in addition to two unstable versions of the Matrix, there have been five iterations, or cycles, of the Matrix. In each stable iteration, an incarnation of The One has appeared. Neo is the sixth One to appear in this sixth Matrix iteration.
Three. Or four including the pre-Matrix beta
We know about the Pre-Matrix Beta 1:
After the Machine war ended, the remaining surviving humans were taken to be studied and plugged into an initial first power plant matrix without their awareness of being plugged into that matrix.
Which was followed by the Paradise Matrix:
The Paradise Matrix was the first prototype Matrix, which was designed by The Architect to control humanity by putting their minds into a constructed virtual reality. Unlike later versions, it simulated a perfect world with no suffering to try to pacify their minds, but the human minds did not accept this version. Many of those connected died, and a Nightmare Matrix was designed in its place that tried to correct its flaws.
Which was followed by the Nightmare Matrix:
The Nightmare Matrix was the second prototype Matrix, designed by The Architect after the massive failure of the Paradise Matrix in the hope that human minds would more readily accept an imperfect world with suffering. Unlike the first version, this Matrix instituted a basic cause-and-effect programming and forcibly made those connected to it accept the program.
And finally the Modern Matrix, which is the one we see in the movies:
The solution was ultimately stumbled upon by an intuitive program, originally intended to study aspects of the human psyche: The Oracle. She discovered that if humans were given a choice, even at a subconscious level, to accept the reality of the world around them, ninety-nine percent of humans would accept the virtual world.