All Andrew examples illustrate correct usage. The difference is idiomatic, there is not a simple rule that captures it. The first meaning of matrimonio is "marriage, matrimony", that is the union between two people and of "nozze" is wedding (ceremony) as Andrew pinpointed.
But sometimes 'matrimonio' can be used to refer to the wedding (ceremony) too. E.g.
Sono stato invitato [alle nozze di/al matrimonio di] Antonio e Laura.
both mean:
I have been invited to Antonio and Laura's wedding (ceremony)
the idiom is:
essere invitato alle nozze/al matrimonio di
English is more precise and does not use marriage to mean wedding, but we use matrimonio because it is clear from the context that you are actually taking part in the celebration, not in the marriage (there is no marriage between three people). If you want to be finicky, the first sentence may mean that you have been invited to the celebrations (that is to eat, drink, sing, and so on). The phrase using matrimonio may mean "invited only to attend the ceremony in the church", but this is unlikely: you may choose not to go the celebration, but you usually *are* invited. Most Italian natives would not see such a subtle difference in meaning.
But here's another example:
È stato un matrimonio semplice.
It has been a simple wedding (ceremony)
In this case you can again use 'matrimonio' to refer to the marriage ceremony and celebrations. With nozze you have to say, because it is plural:
Sono state delle nozze semplici.
but this sentence is a bit less common or formal, although correct.
nozze d'oro = golden wedding/anniversary
this idiom requires nozze, although a couple may not officially celebrate it. You cannot say "matrimonio d'oro", that means another thing, like marrying into money :)
Morale: 'nozze' and 'matrimonio' mean both things, depending on the context and idiom. You have to learn their usage with practice, they are not always interchangeable.
Please upvote if you think this is the better answer :)