We present a protocol to evaluate the expectation value of the correlations of measurement outcomes for ensembles of quantum systems, and use it to experimentally demonstrate--under an assumption of fair sampling--the violation of an inequality that is satisfied by any non-contextual hidden-variables (NCHV) theory. The experiment is performed on an ensemble of molecular nuclear spins in the solid state, using established Nuclear Magnetic Resonance (NMR) techniques for quantum information processing (QIP).