You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
228 B

function z=fitness(Kp,Ki,Kd)
assignin('base','Kp',Kp);
assignin('base','Ki',Ki);
assignin('base','Kd',Kd);
[~,~,y_out]=sim('thetapid',[0,50]);
z=1/(y_out(end,1)); %%表示 取这个 矩阵的第一列最后一行的数据。