How can I flush the output of disp in Matlab or Octave? September 18, 2023 by Tarik Use fflush(stdout) and/or fflush(stderr) to flush the buffer from disp().