![]() |
simulink中MATLAB Function 怎么定义
请教大家simulink中MATLAB Function 怎么定义?我的M文件定义如下:
function [u]=pid_awlf1(u1,u2,u3,u4) e=u2; un=u3; us=u4; M=1; switch M case 1 u=e; case 2 umin=0; umax=10; ua=(umin+umax)/2; if un~=us&e*(un-ua)>0 u=u1; else u=e; end end 出错提示:??? Input argument "u2" is undefined. Error in ==> pid_awlf1 at 2 e=u2; 求教解决办法! |
回复: simulink中MATLAB Function 怎么定义
赋值是从右到左的,所以应该写u2=e
|
所有时间均为北京时间。现在的时间是 11:07。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.