From 7d8eb559ed4623cfbf8de662c4539014feb7a9aa Mon Sep 17 00:00:00 2001 From: TianZhendong <33273211+TianZhendong@users.noreply.github.com> Date: Mon, 8 Apr 2019 15:42:59 +0800 Subject: [PATCH] Create PSO-PID.m --- PSO-PID.m | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 PSO-PID.m diff --git a/PSO-PID.m b/PSO-PID.m new file mode 100644 index 0000000..df3d70c --- /dev/null +++ b/PSO-PID.m @@ -0,0 +1,6 @@ +function z=PSO_PID(x) +assignin('base','Kp',x(1)); +assignin('base','Ki',x(2)); +assignin('base','Kd',x(3)); +[~,~,y_out]=sim('thetapid',[0,50]); +z=y_out(end,1); %%表示 取这个 矩阵的第一列最后一行的数据。