Undefined operator './' for input arguments of type 'function_handle'.
10 views (last 30 days)
Show older comments
guest10011
on 31 Oct 2018
Commented: Walter Roberson
on 1 Nov 2018
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.
3 Comments
Walter Roberson
on 31 Oct 2018
My guess is that Ti is a function handle and that where you refer to Ti you should have Ti(x)
Accepted Answer
Walter Roberson
on 1 Nov 2018
(tj./(log(x(2))+(x(3)./Tj)+x(4)./Vj))
Has function handle tj divided by something
3 Comments
More Answers (0)
See Also
Categories
Find more on Stress and Strain in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!