天一阁 发表于 2011-5-14 10:31

求助!!!!!哪位大侠能帮帮忙!万分感谢!!!!

本帖最后由 牛小贱 于 2014-3-8 21:18 编辑

Simulink仿真时Embedded MATLAB Function模块中的程序如下:
function F = myfun(Alpha_2,Omega_2,Omega_3,Omega_4,Theta_2,Theta_3,Theta_4)
Alpha_2=0;
global rs(1) rs(2) rs(3) rs(4)
rs(1)=304.8;
rs(2)=101.6;
rs(3)=254.0;
rs(4)=177.8;
F(1)=rs(3)*(Alpha_3)*cos(Theta_3)--rs(4)*(Alpha_4)*cos(Theta_4)-rs(2)*(Omega_2)^2*sin(Theta_2)-rs(3)*(Omega_3)^2*sin(Theta_3)+rs(4)*(Omega_4)^2*sin(Theta_4);
F(2)=rs(3)*(Alpha_3)*sin(Theta_3)--rs(4)*(Alpha_4)*sin(Theta_4)+rs(2)*(Omega_2)^2*cos(Theta_2)+rs(3)*(Omega_3)^2*cos(Theta_3)-rs(4)*(Omega_4)^2*cos(Theta_4);
F=;
=fsolve('myun',optimset('Display','off'))运行时产生错误:
Parse: Unbalanced or misused parentheses or brackets.

Function 'myfun' (#30.96.97), line 3, column 10:
"("
Parsing failed.

Function 'myfun' (#30.0.0), line 0, column 0:
""

Errors occurred during parsing of Embedded MATLAB function 'myfun'(#30)

麻烦哪位大侠能帮忙改一下!!!谢谢了!!!!!!!

雨人 发表于 2011-5-17 15:45

你把这段代码,放到一个M文件里面,初始化一个输入,调试一下。多看看提示!好像是少括号不对称了
页: [1]
查看完整版本: 求助!!!!!哪位大侠能帮帮忙!万分感谢!!!!