Experimental violation of the Leggett-Garg inequality with a single-spin system