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

求: MATLAB/Simulink 高人!!!

本帖最后由 天一阁 于 2011-5-14 14:38 编辑

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中的!

yufeng 发表于 2011-5-15 11:34

看看 ff是否正确 还有把最后一行去掉

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

支持楼上
是或否分母太小了,还是在matlab调试一下,比较好!
页: [1]
查看完整版本: 求: MATLAB/Simulink 高人!!!