image thumbnail

PID Controller Design and Tuning with MATLAB and Simulink - Engine Control

by

 

14 Sep 2010 (Updated )

This demo file shows capabilities for PID Controller design and tuning in MATLAB and Simullink.

plot_format(X1, YMatrix1)
function plot_format(X1, YMatrix1)
%CREATEFIGURE(X1,YMATRIX1)
%  X1:  vector of x data
%  YMATRIX1:  matrix of y data

%  Auto-generated by MATLAB on 03-Sep-2010 15:30:22

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
hold(axes1,'all');

% Create multiple lines using matrix input to plot
plot1 = plot(X1,YMatrix1,'Parent',axes1,'MarkerSize',10);
set(plot1(1),'MarkerFaceColor',[0 0 1],'MarkerEdgeColor',[0 0 1],...
    'Marker','square',...
    'DisplayName','Kp');
set(plot1(2),'MarkerFaceColor',[1 0 0],'MarkerEdgeColor',[1 0 0],...
    'Marker','o',...
    'Color',[1 0 0],...
    'DisplayName','Ki');

% Create xlabel
xlabel('Speed (rpm)');

% Create title
title('Gain-Scheduling Proportional and Integral Gains');

% Create legend
legend1 = legend(axes1,'show');
set(legend1,...
    'Position',[0.73771255339672 0.665346540065707 0.152542372881356 0.0995260663507109]);

% Copyright 2013 The MathWorks, Inc

Contact us