Yes, you can do it in a day. Although it's yet to appear on the Michelin maps, the motorway down the coast now starts just south of Tanger.
The fastest way is probably to continue on the motorway all the way down to Casablanca and then head south to Marakech on the P7, however my preference would be to take the motorway only as far as Larache, then go via Meknes, Azrou, Khenifra, etc.
Tim