天一阁 发表于 2011-5-14 14:40

求助!!!!!!!!

Evaluation of expression resulted in an invalid output. Only finite double vector or matrix outputs are supported
function =myfun(u)
Alpha_2=u(1);Omega_2=u(2);Theta_2=u(3);
Omega_3=u(4);Theta_3=u(5);
Omega_4=u(6);Theta_4=u(7);%定义输入的变量
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;
ff(1)=(-(Omega_2)^2*(rs_2)*cos((Theta_2)-(Theta_4))-(Omega_3)^2*(rs_3)*cos((Theta_3)-(Theta_4))+(Omega_4)^2*(rs_4))/((rs_3)*sin((Theta_3)-(Theta_4)));
ff(2)=((Omega_2)^2*(rs_2)*cos((Theta_2)-(Theta_3))-(Omega_4)^2*(rs_4)*cos((Theta_4)-(Theta_3))+(Omega_3)^2*(rs_3))/((rs_4)*sin((Theta_4)-(Theta_3)));
ff=;



该段程序是Simulink仿真模块中MATLAB Function中的!

meiyongyuandeze 发表于 2011-5-14 15:04

回复 1 # 天一阁 的帖子

试下 ff=myfun(u),我对sumulink不是熟悉!
页: [1]
查看完整版本: 求助!!!!!!!!