How can I flush the output of disp in Matlab or Octave?

后端 未结 7 582
借酒劲吻你
借酒劲吻你 2020-12-29 03:20

I have a program in Octave that has a loop - running a function with various parameters, not something that I can turn into matrices. At the beginning of each iteration I p

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 03:54

    From here and elsewhere, there are at least 5 methods to get immediate output, in Octave.

    Use one of the following:

    %---------------------------
    % Turn OFF output buffering
    %---------------------------
    more off                        % command & NOT shown in output
    PAGER = "less"                  % built-in var - shown in output
    page_screen_output = 0          % built-in var - shown in output
    page_output_immediately = 1     % built-in var - shown in output
    fflush(stdout)                  % Need to call after each "output" line
    

提交回复
热议问题