Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有两个单元格数组:
A = {2 2 2 2} B = {[1 2] [3 2] [5 5] [7 7]}
和两个参数的函数:
F = @(a, b) [a * b(1), (b(2) / 3), (b(1) + a) * 22]
我想将该函数应用于两个单元格数组,如下所示:
idealfun(F, A, B)
并让它做正确的事情(返回一个包含四个 1x3 向量单元的单元阵列)。任何想法如何找到/写idealfun?
idealfun
使用CELLFUN。
out = cellfun(F,A,B,'UniformOutput',false);