24小时热门版块排行榜    

CyRhmU.jpeg
查看: 340  |  回复: 1

lpponli

铜虫 (初入文坛)

[求助] 求助大侠们一个小问题啊,小弟matlab没学过,帮忙解个方程组吧。急!

function F=myx(x)
F=[0.3225*80-0.3225*x(1)-12.5*x(2)+12.5*20;
12.5*x(2)-20*12.5-3305.5*(100-x(1)-x(2))/(log((80-x(2))/(x(1)-20)))];
end

clear;
x0 = [21;21];           % Make a starting guess at the solution
options=optimset('Display','iter');   % Option to display output
[x,fval,exitflag,output,jacobian] = fsolve(@myx,x0,options)
结果运行错误。
??? function F=myx(x)
    |
Error: Function definitions are not permitted in this context.
不知道这样的二元方程组怎么编程啊。
原方程是:
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
F=@(x)[0.3225*80-0.3225*x(1)-12.5*x(2)+12.5*20;
12.5*x(2)-20*12.5-3305.5*(100-x(1)-x(2))/(log((80-x(2))/(x(1)-20)))];
x0 = [21;21];           % Make a starting guess at the solution
options=optimset('Display','iter');   % Option to display output
[x,fval,exitflag,output,jacobian] = fsolve(F,x0,options)
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-02-23 15:03:14
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 lpponli 的主题更新
信息提示
请填处理意见