I'm encountering the following Matlab error:
??? Input argument "Va4" is undefined.
Error in ==>
sym.matlabFunction>makeFhandle/@(Va1,Va4,Vm1,Vm4)reshape([cos(conj(Va1)-conj(Va4)).*conj(Vm1).*conj(Vm4).*(6.25e2./7.2e1)+Vm1.*Vm4.*cos(Va1-Va4).*(6.25e2./7.2e1),sin(conj(Va1)-conj(Va4)).*conj(Vm1).*conj(Vm4).*(6.25e2./7.2e1)+Vm1.*Vm4.*sin(Va1-Va4).*(6.25e2./7.2e1),Vm4.*sin(Va1-Va4).*(6.25e2./7.2e1)+sin(conj(Va1)-conj(Va4)).*conj(Vm4).*(6.25e2./7.2e1),Vm1.*(6.25e2./3.6e1)+conj(Vm1).*(6.25e2./3.6e1)-Vm4.*cos(Va1-Va4).*(6.25e2./7.2e1)-cos(conj(Va1)-conj(Va4)).*conj(Vm4).*(6.25e2./7.2e1)],[2,2])
I'm trying to evaluate an anonymous function, a 2x2 matrix, at a point as follows
J = @(Va1,Va4,Vm1,Vm4) reshape( ...
[cos(conj(Va1)-conj(Va4)).*conj(Vm1).*conj(Vm4).*(6.25e2./7.2e1)+Vm1.*Vm4.*cos(Va1-Va4).*(6.25e2./7.2e1),...
sin(conj(Va1)-conj(Va4)).*conj(Vm1).*conj(Vm4).*(6.25e2./7.2e1)+Vm1.*Vm4.*sin(Va1-Va4).*(6.25e2./7.2e1),...
Vm4.*sin(Va1-Va4).*(6.25e2./7.2e1)+sin(conj(Va1)-conj(Va4)).*conj(Vm4).*(6.25e2./7.2e1),...
Vm1.*(6.25e2./3.6e1)+conj(Vm1).*(6.25e2./3.6e1)-Vm4.*cos(Va1-Va4).*(6.25e2./7.2e1)-cos(conj(Va1)-conj(Va4)).*conj(Vm4).*(6.25e2./7.2e1)],...
[2,2]);
arrayfun(J, [0,0,1,1] , 'UniformOutput', false)
Any idea what's going wrong?
EDIT: I should have mentioned that the function J is defined from some other function, so I am unable to provide the inputs as separate arguments. I have attempted to pass the input as a cell as: arrayfun(J, {0,0,1,1} , 'UniformOutput', false); but I run into the following error
??? Undefined function or method 'conj' for input arguments of type 'cell'.
EDIT #2: Solved by Nemesis below, we need to pass the cell input, A = {0,0,1,1} into arrayfun using A{:}.