How to disable the progress bar when using the nlfilter function in Matlab?

后端 未结 1 1073
小蘑菇
小蘑菇 2021-01-28 06:29

Each time I call the nlfilter function a progress bar window appears. How could I disable that window?. Is there an option like -q?

I\'m proces

相关标签:
1条回答
  • 2021-01-28 06:49

    The waitbar within MATLAB definitely reduces the performance of your code as well as gets really obnoxious when running long-running tasks on some operating systems as it can steal the focus of your keyboard/mouse randomly.

    I personally create my own waitbar function and place it on the MATLAB path so that it is evaluated rather than the built-in.

    I have a more complicated text-based progress bar, but the following function will simply print the messages to the command line. You could even remove the first block and have the contents simply be varargout = {[]}; and you will have no output.

    function varargout = waitbar(varargin)
        if nargin >= 2 && ischar(varargin{2})
            disp(varargin{2})
        elseif nargin >= 3 && ischar(varargin{3})
            disp(varargin{3})
        end
        varargout = {[]};
    end
    

    Be sure to save this in waitbar.m somewhere high on your MATLAB path.

    NOTE: This will silence all waitbars so if you want to restore the typical waitbar behavior, you will want to remove/rename this file.

    0 讨论(0)
提交回复
热议问题