cpeval.m

来自「CELP (CELl Processing) is a functional p」· M 代码 · 共 22 行

M
22
字号
function y = cpeval(m,f,varargin)%CPEVAL Evaluate multioutput function and return outputs in cell array.%   Y = CPEVAL(M,F,X1,...Xn) returns Y = {Y1,...YM} s.t. [Y1,...YM] =%   F(X1,...Xn).%%   Examples%   --------%%   %Getting the second output of sort%   feval(@(x) x{2},cpeval(2,@sort,rand(100,1)))%%   %Applying cell2mat to multiply outputs from cpmap%   [x,y] = feval(...%       @(x) deal(x{:}),...%       cpmap(...%           @cell2mat,...%           cpeval(2,@cpmap,@size,{ones(1,2),ones(3,4)})...%        )...%   )    [y{1:m}] = f(varargin{:});end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?