longhao11
2009-07-06, 12:38
To get started, select MATLAB Help or Demos from the Help menu.
>> g1=tf(0.03,[0.012 0.13 0.3009]);%电机传递函数
g2=tf([5000 200],[1 0]);%内环PI控制器
g3=feedback(g1*g2,1);%内环传递函数
g4=tf(1,[1 0]);%积分环节
g5=tf(24500,[1 98 4900]);%机械系统传递函数
for kp=[2:2:10];%设定kp的范围2~10
g6=tf([0.01 kp 0.0001],[1 0]);%外环PID控制器
g7=g6*g3*g4*g5;%系统开环传递函数
g8=feedback(g7,1);%系统闭环传递函数
step(g8)%阶跃响应
hold on
end
我在MATLAB中输入以上程序,可是确出来下面的结果,请问是哪里出了问题,怎么解决,谢谢了.
??? Error: File: E:\mathworks\toolbox\shared\controllib\@ctrluis\@plotarray\plotarray.m Line: 40 Column: 20
The construct "min(...end...)" is ambiguous in this context,
because "min" cannot be ascertained to be either the name of a variable
or of a function. To make it a variable, assign to it; to allow it to
become a function at execution time, replace "end" with a call to
LENGTH, SIZE, or NUMEL on the desired array.
>>
>> g1=tf(0.03,[0.012 0.13 0.3009]);%电机传递函数
g2=tf([5000 200],[1 0]);%内环PI控制器
g3=feedback(g1*g2,1);%内环传递函数
g4=tf(1,[1 0]);%积分环节
g5=tf(24500,[1 98 4900]);%机械系统传递函数
for kp=[2:2:10];%设定kp的范围2~10
g6=tf([0.01 kp 0.0001],[1 0]);%外环PID控制器
g7=g6*g3*g4*g5;%系统开环传递函数
g8=feedback(g7,1);%系统闭环传递函数
step(g8)%阶跃响应
hold on
end
我在MATLAB中输入以上程序,可是确出来下面的结果,请问是哪里出了问题,怎么解决,谢谢了.
??? Error: File: E:\mathworks\toolbox\shared\controllib\@ctrluis\@plotarray\plotarray.m Line: 40 Column: 20
The construct "min(...end...)" is ambiguous in this context,
because "min" cannot be ascertained to be either the name of a variable
or of a function. To make it a variable, assign to it; to allow it to
become a function at execution time, replace "end" with a call to
LENGTH, SIZE, or NUMEL on the desired array.
>>