A) Schematic of closed loop paradigm. Briefly, the participant with 100+ electrodes recording iEEG (top left) performed MSIT (top right) on a desktop computer. A real time state estimator based in MATLAB (bottom right) calculated xbase and xconflict after each trial. This estimator included a threshold-based controller that then triggered stimulation from a neurostimulator (bottom left) on the next trial if the state was above a pre-determined threshold. The real time state estimates were displayed on a MATLAB based GUI. B) Effect of open-loop stimulation (solid bars) vs. closed-loop stimulation (dashed bars) on xbase. At dorsal sites within the capsule, closed-loop stimulation was more effective at reducing xbase (improving task performance, ***p<0.001). C) Effect of open- vs. closed-loop stimulation on xconflict. Simulation conditioned on xbase did not reduce xconflict, and in fact significantly increased it at multiple sites (***p<0.001). D) Comparison of open- vs. closed-loop effects on xbase (Δxbase) (with 0 representing no change from NS1) divided by the number of stimulated trials (Nstim). A negative value indicates a decrease (desired) in xbase caused by a specific stimulation on a block level. State values in B, C are normalized so that unstimulated blocks have a mean state value of 1 for each participant for both experiments, permitting comparison across participants. Significance is determined by a permutation test given the highly autocorrelated data. p-values (versus no stimulation: *p < 0.05; **p < 0.01; ***p <0.001; versus open loop stimulation: ++ p<0.001) are reported after correcting for multiple comparisons using a false discovery rate. Number of subjects (n) for each experiment is specified on the X-axis for open- and closed-loop participants. Markers represent individual participants, bars show the median (dashed line) and the bar maxima/minima correspond to 75th and 25th percentile respectively, error bars show standard error of the mean. Red crosses represent the mean values.