cellfun函数 matlab,关于这个cellfun函数是怎么用的?

cellfun函数在MATLAB中用于对cell数组的每个单元格应用指定函数,并返回结果。该函数支持单输入和多输入,以及处理返回多个输出的情况。通过'UniformOutput'参数可以选择是否将结果组合为数组或保持为cell数组。此外,还可以定义错误处理函数来处理在调用过程中出现的错误。cellfun还支持一些预定义的操作,如检查是否为实数、空数组、逻辑数组等。
摘要由CSDN通过智能技术生成

% CELLFUN Apply a function to each cell of a cell array.

%   A = CELLFUN(FUN, C) applies the function specified by FUN to the

%   contents of each cell of cell array C, and returns the results in

%   the array A.  A is the same size as C, and the (I,J,...)th element of A

%   is equal to FUN(C{I,J,...}). FUN is a function handle to a function

%   that takes one input argument and returns a scalar value. FUN must

%   return values of the same class each time it is called.  The

%   order in which CELLFUN computes elements of A is not specified and

%   should not be relied on.

%

%   If FUN represents a set of overloaded functions, then CELLFUN follows

%   MATLAB dispatching rules in calling the function.

%

%   A = CELLFUN(FUN, B, C, ...) evaluates FUN using the contents of the

%   cells of cell arrays B, C, ... as input arguments.  The (I,J,...)th

%   element of A is equal to FUN(B{I,J,...}, C{I,J,...}, ...).  B, C, ...

%   must all have the same size.

%

%   [A, B, ...] = CELLFUN(FUN, C, ...), where FUN is a function handle to a

%   function that returns multiple outputs, returns arrays A, B, ...,</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值