📜  MATLAB返回

📅  最后修改于: 2021-01-07 02:20:50             🧑  作者: Mango

MATLAB返回

命令return只是将控件返回到调用函数。

例:

    function animatebar (t0,tf,x0);
    % animatebar animates a bar pendulum.
    :
    disp ('Do you want to see the phase portrait?')
    ans = input ('Enter 1 if YES, 0 if NO');
    if ans==0            % see text for description        
        return            % if the input is 0
                    % exit function
    else
               plot (x,......)        % show the phase plot
    end