MATLAB: How to use arrayfun with a function having two vector arguments

arrayfunctionmatrixvector

I have a function f(W,x), where W is a matrix and x is a vector. I would like to use arrayfun to calculate the f(W,x) for several x but constant/fix W. What is the syntax?

Best Answer

fW = @(x) f(W, x);
out = cellfun(fW,{x1,x2,x3},'un',0);