입력인수가 부족하다는 오류가 발생합니다.
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
function F = comp(x)
F(1) = (((x(1)+x(2)-x(6))*(2*x(1)+x(2)+x(3)+x(4))^2))/((100-x(1)-x(3)+x(5)-x(6))*((1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^4)) - 2.937*10^5;
F(2) = ((x(1)+x(2)-x(6))*(2*x(1)+x(2)+x(3)+x(4)))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^3) - 1.046*10^7;
F(3) = ((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(2*x(1)+x(2)+x(3)+x(4)))/((100-x(1)-x(3)+x(5)-x(6))*(1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))) - 0.02808;
F(4) = (2*x(1)+x(2)+x(3)+x(4))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))*(467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))) - 5.555*10^5;
F(5) = (100-x(1)-x(3)+x(5)-x(6))/((100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))^2) - 1.978*10^6;
F(6) = (((1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6))^2)*(100-x(2)+x(3)-x(4)-2*x(5)+2*x(6))^2)/((x(1)+x(2)-x(6))*(100-x(1)-x(3)+x(5)-x(6))) - 1.166*10^(-9);
end
function chem
fun = @comp;
x0 = [0,0,0,0,0,0];
x= fsolve(fun,x0)
CO = 100-x(2)+x(3)-x(4)-2*x(5)+2*x(6)
CO2 = 100-x(1)-x(3)+x(5)-x(6)
H2 = 1467-4*x(1)-3*x(2)-x(3)-x(4)+2*x(6)
CH4 = x(1)+x(2)-x(6)
H2O = 2*x(1)+x(2)+x(3)+x(4)
C = x(4)+x(5)
end
비선형 연립방정식을 풀고 싶은데 실행하면 입력 인수가 부족하다고 나오네요 ㅠ
어떻게 해결해야 풀릴까요?
0 个评论
回答(1 个)
Raj
2023-10-3
0 个投票
안녕 성호 조
나는이 질문에 영어로 대답 할 것이다
I understand that you are getting “input arguments are insufficient” error while running your script.
This is due to the function ‘comp’ in your file. This error throws up when the compiler tries to run the function ‘comp’.
Try following the workaround I gave in a similar question of yours to solve the issue:
I hope this helps.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!