I have a following issue. I am trying to create a function handle, which is a vector. In particular, I have something like this
EQ0 = @(W) m1.^2*(exp(W))-m2.^2
where m1 and m2 are the vectors of the same dimension. So, for each m1(i) and m2(i) I want to have a handle W(i). I need it in order to find those W(i)'s in the next step using fsolve in something looking like this
n=size(m1)
x0 = zeros(n);
Wbar = fsolve(EQ0,x0)
I have tried using arrayfun, but received a following error
EQ0 = arrayfun( @(W) m1.^2*(exp(W))-m2.^2, m1=m1e, m2=m2e)
Error: The expression to the left of the equals sign is not a valid target for an assignment.
Another attempt in using arrayfun resulted in this (here I just used m1 and m2 vectors directly, not as an inputs like in previous case)
EQ0 = arrayfun( @(W) m1.^2*(exp(W))-m2.^2,:)
Undefined variable arrayfun.
I am clearly missing something. I have looked on some feeds on arrayfun but it looks like my problem is somewhat different.
Any advice is appreciated.