I have a matrix and a vector in MATLAB defined:
A=rand(3);
x=rand(3,1);
And a function that takes these types of input arguments:
b = MacVecProd(A,x);
However, I'd like to use this function's function handle in order to apply it to my values. I thought that I could use cellfun
for this, but:
v = {A,x};
cellfun(@MatVecProd_a, v{:})
Gives the error:
Error using cellfun
Input #2 expected to be a cell array, was double instead.
How do I do this correctly?