Matlab闭包

function [ f ] = closure( base )

    function [ans] = h(t)
        ans = base + t;
    end
    f = @h;
end

简单的测试了下,确实Matlab支持闭包- -

by 1957
原文地址:https://www.cnblogs.com/x1957/p/2498908.html