Both cities are nice.
When you go to Madrid, you should see Toledo, which is nearby.
I found a cheap and fast (bullet) train from Madrid to Seville, which is also a very nice town.
Remember: Most shops a closed from 1:00 PM to 3:00 PM or so. And the Spanish people eat late, very late (10:00 PM ..).