matlab - How to apply cellfun (or arrayfun or structfun) with constant extra input arguments? -


I want to apply the function to each element of a cell array - so I have the cellphone for. However, the function takes two additional logic (a string and a vector), which I want to keep for all elements of the cell array; That is, I would like to do something like this:

  Cellphone (@Myphan, Selarre, Co.1, Const 2)  

Meaning:

 I = 1 for : numel (cellarre), mayfan (cellar {i}, const1, const2); There is no way to do this without creating intermediate cell arrays with  numel (cellarray)   const1  and   

Const2 ?

You can do that call myfun two additional arguments With:

  cellphone (@ (x) myfun (x, const1, const2), cellar)  

Comments