MATLAB: Undefined operator ‘./’ for input arguments of type ‘function_handle’.

function handle

Hello,
The part of the code I developed is exhibited below:
deriv1 = @(x) (sum(log(ti(x))-log(x(2))-(x(3)./Ti)-(x(4)./Vi)-log(tj(x)./(log(x(2))+(x(3)./Tj)+(x(4)./Vj))).*(tj./(log(x(2))+(x(3)./Tj)+x(4)./Vj)).^x(1))+sum(- log(ti(x)./(log(x(2))+x(3)./Vi + x(4)./Vi)).*(ti(x)./(log(x(2))+ x(3)./Vi + x(4)./Vi)).^x(1) + 1./x(1)));
% Derivative dL/dA
%deriv2 = @(x) -(x(1).*(sum((Vj.^x(3).*tj(x).*x(2)).^x(1))+sum((Vi.^x(3).*ti(x).*x(2)).^x(1))-1))./x(2);
deriv2 = @(x) (sum((x(1).*tj(x).*(tj(x)./(log(x(2)) + x(3)./Tj + x(4)./Vj)).^(x(1) - 1))./(x(2).*(log(x(2)) + x(3)./Tj + x(4)./Vj).^2) - x(1)./x(2)) + sum((x(1).*ti(x).*(ti(x)./(log(x(2)) + x(3)./Vi + x(4)./Vi)).^(x(1) - 1))./(x(2).*(log(x(2)) + x(3)./Vi + x(4)./Vi).^2)));
% Derivative dL/dx(3)
deriv3 = @(x) (sum((x(1).*tj(x).*(tj(x)./(log(x(2)) + x(3)./Tj + x(4)./Vj)).^(x(1) - 1))./(Tj.*(log(x(2)) + x(3)./Tj + x(4)./Vj).^2)) + sum (- x(1)./Ti + (x(1).*ti(x).*(ti(x)./(log(x(2)) + x(3)./Vi + b./Vi)).^(x(1) - 1))./(Vi*(log(x(2)) + x(3)./Vi + x(4)./Vi).^2)));
% Derivative dL/b
deriv4 = @(x) (sum((x(1).*tj(x).*(tj(x)./(log(x(2)) + x(3)./Tj + x(4)./Vj)).^(x(1) - 1))./(Vj.*(log(x(2)) + x(3)./Tj + x(4)./Vj).^2)) + sum( - x(1)./Vi + (x(1).*ti(x).*(ti(x)./(log(x(2)) + x(3)./Vi + x(4)./Vi)).^(x(1) - 1))./(Vi.*(log(x(2)) + x(3)./Vi + x(4)./Vi).^2)));
I keep receiving the error message:
Undefined operator './' for input arguments of type 'function_handle'.
Error in
Example>@(x)(sum(log(ti(x))-log(x(2))-(x(3)./Ti)-(x(4)./Vi)-log(tj(x)./(log(x(2))+(x(3)./Tj)+(x(4)./Vj))).*(tj./(log(x(2))+(x(3)./Tj)+x(4)./Vj)).^x(1))+sum(-log(ti(x)./(log(x(2))+x(3)./Vi+x(4)./Vi)).*(ti(x)./(log(x(2))+x(3)./Vi+x(4)./Vi)).^x(1)+1./x(1)))
I was wondering where I was making the mistake. I have checked this part several times. Any help will be appreciated.

Best Answer

  • (tj./(log(x(2))+(x(3)./Tj)+x(4)./Vj))
    Has function handle tj divided by something