One way is to use the search:field_name parameter on your Channel Entries tag. You can use it like...
search:your_matrix_field="not IS_EMPTY"
...and it will only return entries that actually have content in your Matrix field.
Alternatively, Adrian Macneil just released a nifty plugin called Channel Query that is perfect for this. It works just like the Channel Entries tag but allows you to specify a custom query to get just the entry_ids you need. So in this case you'd select entries where your Matrix field is not empty.
This will loop over all the entries that have Matrix data:
{exp:channel_query sql="SELECT entry_id FROM exp_channel_data WHERE field_id_22 != '' AND channel_id = '12'"}
{title}<br>
{/exp:channel_query}
Substitute the field_id for your Matrix field's id and channel_id for your particular Channel.
If instead you want only the total results you can just use the Query module:
{exp:query sql=
"SELECT COUNT(exp_channel_data.entry_id) AS total
FROM exp_channel_data
JOIN exp_channel_titles
ON exp_channel_titles.entry_id = exp_channel_data.entry_id
WHERE field_id_22 != ''
AND status = 'open'
AND exp_channel_data.channel_id = '12'"
}
{total}
{/exp:query}
For either of these queries you can change to showing/counting only entries that do not have any Matrix data by altering the field_id_X != ''
to field_id_X = ''