Measurement-based quantum computation (MBQC) represents a powerful and flexible framework for quantum information processing, based on the notion of entangled quantum states as computational resources. The most prominent application is the one-way quantum computer, with the cluster state as its universal resource. Here we demonstrate the principles of MBQC using deterministically generated graph states of up to 7 qubits, in a system of trapped atomic ions. Firstly we implement a universal set of operations for quantum computing. Secondly we demonstrate a family of measurement-based quantum error correction codes, and show their improved performance as the code length is increased. We show that all our graph states violate a multipartite Bell inequality and are therefore capable of information processing tasks that cannot be described by a local hidden variable model. The methods presented can directly be scaled up to generate graph states of several tens of qubits.The circuit model of quantum computation is conceptually similar to a classical computer: a register of two-level systems in a simple initial product state are manipulated using unitary quantum logic gates [1]. MBQC [2] represents a conceptually and practically different approach: after preparing an entangled cluster state of qubits [3], computation proceeds by performing measurements and feedforward. Both approaches present different theoretical and practical challenges to realisation and warrant investigation in parallel.Recently, researchers have found novel applications for MBQC beyond universal QC, including e.g. blind quantum computation [4, 5] measurement-based entanglement purification [6] and quantum error correction [7], featuring very high thresholds. Owing to the two-stage process of MBQC -resource creation followed by its processing -resources states can be purified and manipulated beforehand. This offers a large degree of flexibility in optimizing and compressing schemes for quantum information processing. Schemes for correcting errors in universal MBQC have also been found with extremely high tolerence to errors, compared to those known for the circuit model of QC [7][8][9].Important experimental progress on MBQC has been made using entangled states of up to 8 photonic qubits [10][11][12]. Scaling up the non-deterministic methods used to generate entangled states in these works is very challenging, since their success probably reduces exponentially in photon number. Very recently there has been work on generating cluster states in continuous variables of light fields [13].In this work we present the first demonstration of MBQC using trapped ions. Furthermore, we make two experimental steps forward in the model of MBQC that are systemindependent: the deterministic generation of cluster states and the demonstration of quantum error correction (QEC). The paper is organised as follows; firstly MBQC is briefly reviewed and our approach to preparing cluster states is summarised; then a universal set of operations is presented using a 4 qubit...