Yes however this network is organized in a star layout, meaning there are few connections between the outer cities. If all you want is to visit Madrid from the coast, sure. But going from one coastal city to another, that's not happening. And don't get me started on the rail network towards Portugal.