Let the width of the terrace be \( w \) yards. Since the length is 2 yards greater than the width, we can express the length as \( l = w + 2 \) yards.
The perimeter \( P \) of a rectangle is given by the formula:
\[ P = 2l + 2w \]
Matt has 24 yards of material for the fence, so we set the perimeter equal to 24:
\[ 2l + 2w = 24 \]
We can simplify this equation by dividing everything by 2:
\[ l + w = 12 \]
Now we can substitute \( l = w + 2 \) into this equation:
\[ (w + 2) + w = 12 \]
Combining like terms gives us:
\[ 2w + 2 = 12 \]
Subtracting 2 from both sides:
\[ 2w = 10 \]
Dividing both sides by 2:
\[ w = 5 \]
Now that we have the width, we can find the length:
\[ l = w + 2 = 5 + 2 = 7 \]
Thus, the length of the terrace should be 7 yards.