⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpfilter.m

📁 CELP (CELl Processing) is a functional programming package for Matlab. It is often better to use FP
💻 M
字号:
function varargout = cpfilter(p,varargin)%CPFILTER Analogue of Lisp's FILTER.%   [Y1,...Yn] = CPFILTER(P,X1,...Xn) returns al such X1,...Xn that%   LOGICAL(P(X1,...Xn)) is not false.%%   All Xi must be cell arrays otherwise they are converted using%   NUM2CELL. CLASS(Yi) == CLASS(Xi).%%   Examples%   --------%%   [x,y,z] = cpfilter(@(x,y,z) x>y&y>z,1:4,[1 1 1 5],[1 1 0 1])%%   %Get vectors%   vectors = cpfilter(@isvector,{1:4,[1;2],[],[1 2;3 4]})trues = logical(cell2mat(cpmap(p,varargin{:})));varargout = cell(1,nargin);for k = 1:length(varargin)    varargout{k} = varargin{k}(trues);end

⌨️ 快捷键说明

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