% %step1
% load('GaPid.mat');
% load('FuzzyPid.mat');
% load('Pid.mat');
% load('step1.mat');
% load('test.mat');
% plot(step1.time,step1.signals.values,'r','LineWidth',1);
% hold on;
% plot(test.time,test.signals.values,'.-k','LineWidth',1);
% hold on;
% plot(FuzzyPid.time,FuzzyPid.signals.values,'b','LineWidth',1);
% hold on;
% plot(GaPid.time,GaPid.signals.values,'g','LineWidth',1);
% hold on;
% plot(Pid.time,Pid.signals.values,'m','LineWidth',1);
% set(gca,'FontSize',30);%设置坐标轴
%
% xlabel('Time/s','FontSize',30,'FontName','Times Rew Roman');
% ylabel('F/N','FontSize',30,'FontName','Times Rew Roman');
% %增加图例
% legend('STEP','Ga Fuzzy PID','Fuzzy PID','Ga PID','PID','FontSize',20,'FontName','Times Rew Roman','Location','NorthEast');
%legend('boxoff') %取消图例边框
% %设置背景为白色
% set(gcf,'color','w');
% box off;
%
%
% axes('Position',[0.5,0.2,0.25,0.35]);
% plot(step1.time,step1.signals.values,'r','LineWidth',1);
% hold on;
% plot(test.time,test.signals.values,'.-k','LineWidth',1);
% hold on;
% plot(FuzzyPid.time,FuzzyPid.signals.values,'b','LineWidth',1);
% hold on;
% plot(GaPid.time,GaPid.signals.values,'g','LineWidth',1);
% hold on;
% plot(Pid.time,Pid.signals.values,'m','LineWidth',1);
% set(gca,'FontSize',20);%设置坐标轴
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%step2
load('GaPidstep2.mat');
load('FuzzyPidstep2.mat');
load('Pidstep2.mat');
load('step2.mat');
load('teststep2.mat');
set(gcf, 'Position', [200 100 1000 600]);
plot(step2.time,step2.signals.values,'r','LineWidth',1);
hold on;
plot(teststep2.time,teststep2.signals.values,'.-k','LineWidth',1);
hold on;
plot(FuzzyPidstep2.time,FuzzyPidstep2.signals.values,'b','LineWidth',1);
hold on;
plot(GaPidstep2.time,GaPidstep2.signals.values,'g','LineWidth',1);
hold on;
plot(Pidstep2.time,Pidstep2.signals.values,'m','LineWidth',1);
set(gca,'FontSize',25);%设置坐标轴
set(gca,'linewidth',1);%坐标轴加粗
xlabel('Time/s','FontSize',25,'FontName','Times Rew Roman');
ylabel('F/N','FontSize',25,'FontName','Times Rew Roman');
%增加图例
legend('Expected Force','Ga Fuzzy PID','Fuzzy PID','Ga PID','PID','FontSize',15,'FontName','Times Rew Roman','Location','NorthWest');
legend('boxoff') %取消图例边框
box off;
ax1 = axes('Position',get(gca,'Position'),'XAxisLocation','top','YAxisLocation','right','Color','none','XColor','k','YColor','k'); % 设置坐标区
set(ax1,'XTick', [],'YTick', []); % 去掉xy轴刻度
set(ax1, 'LineWidth', 1);%加粗线条
%设置背景为白色
set(gcf,'color','w');
box off;
axes('Position',[0.7,0.6,0.20,0.31]);
plot(step2.time,step2.signals.values,'r','LineWidth',1.75);
hold on;
plot(teststep2.time,teststep2.signals.values,'.-k','LineWidth',1);
hold on;
plot(FuzzyPidstep2.time,FuzzyPidstep2.signals.values,'b','LineWidth',1);
hold on;
plot(GaPidstep2.time,GaPidstep2.signals.values,'g','LineWidth',1);
hold on;
plot(Pidstep2.time,Pidstep2.signals.values,'m','LineWidth',1);
set(gca,'FontSize',15);%设置坐标轴
set(gca,'linewidth',1);%坐标轴加粗
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%正弦曲线
% load('sin.mat');
% load('pidsin.mat');
% load('gasin.mat');
% load('fuzzysin.mat');
% load('testsin.mat');
% % load('step2.mat');
% % load('teststep2.mat');
% set(gcf, 'Position', [200 100 1000 600]);
% plot(sin.time,sin.signals.values,'r','LineWidth',1.75);
% hold on;
% plot(testsin.time,testsin.signals.values,'x-k','LineWidth',1);
% hold on;
% plot(fuzzysin.time,fuzzysin.signals.values,'.--b','LineWidth',1);
% hold on;
% plot(gasin.time,gasin.signals.values,'g','LineWidth',1);
% hold on;
% plot(pidsin.time,pidsin.signals.values,'m','LineWidth',1);
%
% set(gca,'FontSize',25);%设置坐标轴
% set(gca,'linewidth',1);%坐标轴加粗
% xlabel('Time/s','FontSize',25,'FontName','Times Rew Roman');
% ylabel('F/N','FontSize',25,'FontName','Times Rew Roman');
% legend('Expected Force','Ga Fuzzy PID','Fuzzy PID','Ga PID','PID','FontSize',15,'FontName','Times Rew Roman','Location','NorthEast');
% legend('boxoff') %取消图例边框
% box off;
% ax1 = axes('Position',get(gca,'Position'),'XAxisLocation','top','YAxisLocation','right','Color','none','XColor','k','YColor','k'); % 设置坐标区
% set(ax1,'XTick', [],'YTick', []); % 去掉xy轴刻度
% set(ax1, 'LineWidth', 1);%加粗线条
% set(gcf,'color','w');
%
% axes('Position',[0.25,0.72,0.2,0.2]);
% plot(sin.time,sin.signals.values,'r','LineWidth',1.75);
% hold on;
% plot(testsin.time,testsin.signals.values,'.-k','LineWidth',1);
% hold on;
% plot(fuzzysin.time,fuzzysin.signals.values,'.-b','LineWidth',1);
% hold on;
% plot(gasin.time,gasin.signals.values,'g','LineWidth',1);
% hold on;
% plot(pidsin.time,pidsin.signals.values,'m','LineWidth',1);
% set(gca,'FontSize',10);%设置坐标轴
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %柱状图Y=[426.3075,0.2047,51.5646];
% Y=[426.3075,5,51.5646];
% X=1:3;
% set(gcf, 'Position', [200 100 1000 600]);
% h=bar(X,Y,0.5);
% set(gca,'FontSize',20);%设置坐标轴
% set(gca,'YLim',[0 500]);
% set(gcf,'color','w');
% xlabel('Number of variables(3)','FontSize',25,'FontName','Times Rew Roman');
% ylabel('Current Best individual','FontSize',25,'FontName','Times Rew Roman');
% box off;
% set(gca,'linewidth',1);%坐标轴加粗
% ax1 = axes('Position',get(gca,'Position'),'XAxisLocation','top','YAxisLocation','right','Color','none','XColor','k','YColor','k'); % 设置坐标区
% set(ax1,'XTick', [],'YTick', []); % 去掉xy轴刻度
% set(ax1, 'LineWidth', 1);%加粗线条
03-16
3307
07-22
39万+
03-28
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交