To run the model, enter >> runModel.m into Matlab. Use variable "cond" in runModel.m to simulate different conditions: cond=1 Dichoptic gratings / attended (attended rivalry) cond=2 Dichoptic gratings / unattended (unattended rivalry) cond=3 Monocular plaids / attended cond=4 Monocular plaids / unattended cond=5 Swapping experiment with a blank gap before swap (blank-before-swap condition) cond=6 Swapping experiment with no blank (static image condition) cond=7 Swapping experiment with flicker (flicker-and-swap condition) Equations of the model for forward Euler's method are in n_model.m Parameters values and input strength are assigned in setParameters.m Please cite this paper if this code is used in or to motivate any publications. Li H-H, Rankin J, Rinzel J, Carrasco M, Heeger DJ (2017) Attention Model of Binocular Rivalry. PNAS If you modify and distribute the code, please include this README.txt file. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.