帮一帮pid控制代码的注释

subplot(221);
plot(t,ref(:,1)-x,'-r','Linewidth',2);
grid;
title('error in x(m) vs time(s)')
subplot(222);
plot(t,ref(:,2)-y,'-r','Linewidth',2);
grid;
title('error in y(m) vs time(s)')
subplot(223);
plot(t,ref(:,3)-z,'-r','Linewidth',2);
grid;
title('error in z(m) vs time(s)')
subplot(224);
plot(t,(ref(:,4)-psi)*180/pi,'-r','Linewidth',2);
grid;
title('error in psi(yaw)(deg) vs time(s)')

% 绘制四个子图
subplot(221); % 第一个子图
plot(t,ref(:,1)-x,'-r','Linewidth',2); % 绘制 x 方向误差随时间的变化
grid; % 显示网格线
title('error in x(m) vs time(s)') % 添加标题

subplot(222); % 第二个子图
plot(t,ref(:,2)-y,'-r','Linewidth',2); % 绘制 y 方向误差随时间的变化
grid; % 显示网格线
title('error in y(m) vs time(s)') % 添加标题

subplot(223); % 第三个子图
plot(t,ref(:,3)-z,'-r','Linewidth',2); % 绘制 z 方向误差随时间的变化
grid; % 显示网格线
title('error in z(m) vs time(s)') % 添加标题

subplot(224); % 第四个子图
plot(t,(ref(:,4)-psi)*180/pi,'-r','Linewidth',2); % 绘制偏航角误差随时间的变化(以度为单位)
grid; % 显示网格线
title('error in psi(yaw)(deg) vs time(s)') % 添加标题