I do some revisions to my equation but I still got no answer. It says that there is no enough input argument. Can someone please help me?
조회 수: 7 (최근 30일)
이전 댓글 표시
function f=rle(x)
f(1)=x(2)+x(3)+x(5)+x(7)-2758.6474;
f(2)=2*x(1) + 2*x(4) + 4*x(5)-5684.5402;
f(3)=x(2) +2*x(3)+x(4)-4292.1525;
f(4)=2*x(6)-6422.3564;
f(5)=((x(1)^3)*(x(2))/(x(4)*x(5)))-(1893.12055);
f(6)=(x(1)*x(3))/(x(2)*x(4))-(0.7631343);
f(7)=((x(1)*x(2))/x(4))-(32.200985);
>> x0=[150;150;150;150;150;150;150];
x=fsolve(rle,x0);
Not enough input arguments.
Error in rle (line 2)
f(x)=x(2)+x(3)+x(5)+x(7)-2758.6474;
댓글 수: 0
채택된 답변
VBBV
2022년 5월 11일
편집: VBBV
2022년 5월 11일
x0=[150;150;150;150;150;150;150];
% x = 1:7; % give input vector to fucntion
sol=fsolve(@rle,x0) % call the function using function handle
plot(sol)
function f=rle(x)
f(1)=x(2)+x(3)+x(5)+x(7)-2758.6474;
f(2)=2*x(1) + 2*x(4) + 4*x(5)-5684.5402;
f(3)=x(2) +2*x(3)+x(4)-4292.1525;
f(4)=2*x(6)-6422.3564;
f(5)=((x(1)^3)*(x(2))/(x(4)*x(5)))-(1893.12055);
f(6)=(x(1)*x(3))/(x(2)*x(4))-(0.7631343);
f(7)=((x(1)*x(2))/x(4))-(32.200985);
end
댓글 수: 1
Alex Sha
2022년 5월 11일
There are multi-solutions:
No. 1 2
x1 -206.504477863007 191.355831175864
x2 -249.192353855846 236.471139659005
x3 1471.63884269976 1325.22038022388
x4 1598.06716845633 1405.24059989323
x5 725.353704703337 622.836834465451
x6 3211.1782 3211.1782
x7 810.847206452752 574.119045651664
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
