cellfun
📝 Syntax
📥 Input argument
📤 Output argument
📄 Description
💡 Examples
🔗 See also
🕔 History
Version
📄 Description
Last updated
Last updated
greetings = {'Hello', 'Guten Tag', 'Sawadee', 'Bonjour', 'Namaste', ''};
R = cellfun('size', greetings, 1)
R1 = cellfun('size', greetings, 2)C = {1:10, eye(3,4), eye(5,6)};
f = str2func('size');
[nrows_1, ncols_1] = cellfun(f, C,'UniformOutput', false)
[nrows_2, ncols_2] = cellfun(f, C,'UniformOutput', true)function r = fun1(x, y)
r = x > y;
end
function result = errorfun(S, varargin)
disp(nargin())
disp(S)
disp(class(varargin))
disp(size(varargin))
disp(varargin{1})
disp(varargin{2})
result = false;
endR = str2func('fun1');
H = str2func('errorfun');
A = {rand(3)};
B = {rand(5)};
AgtA = cellfun(R, A, B, 'ErrorHandler', H, 'UniformOutput', true)
AgtB = cellfun(R, A, B, 'ErrorHandler', H, 'UniformOutput', false)