www.gusucode.com > Chapter_9 > Chapter_9/Chapter_9/Section_6/Chapter_9_Section_6_Script.m

    %Book Title: Practical Design and Application of MPC
%Chapter: 9
%Section: 6
%Authors: Nassim Khaled and Bibin Pattel
%Last Modified: 10/07/2017
%%
close all
[hAx,hLine1,hLine2] = plotyy(PWM_Input(:,1),PWM_Input(:,2),Motor_Speed_RPM_Filtered(:,1),Motor_Speed_RPM_Filtered(:,2));
title('PWM Command Vs Motors Speed Output')
xlabel('Time [sec]')

ylabel(hAx(1),'PWM Command') % left y-axis 
ylabel(hAx(2),'Motor Speed Output RPM') % right y-axis
grid on
set(gcf,'color',[1 1 1]);
hLine1.LineWidth = 2;
hLine2.LineWidth = 2;

save Chapter_9_Section_5_System_ID_Data.mat PWM_Input Motor_Speed_RPM_Filtered Motor_Speed_RPM_Unfiltered