Undefined operator './' for input arguments of type 'function_handle'.
조회 수: 7 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2018년 10월 31일
My guess is that Ti is a function handle and that where you refer to Ti you should have Ti(x)
채택된 답변
Walter Roberson
2018년 11월 1일
(tj./(log(x(2))+(x(3)./Tj)+x(4)./Vj))
Has function handle tj divided by something
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Stress and Strain에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!