Code Matlab
Code Matlab
close all
clc
load DatosExperimentales
ainy=DatosExperimentales;
% figure(1)
% % plot(ainy(:,3),'k')
% p=ainy(:,3);
% % % Example 1:
% % % Zero-phase filter a noisy ECG waveform using an IIR filter.
% % [b,a] = butter(25,0.33,'low'); % IIR filter design
% % y = filtfilt(b,a,x); % zero-phase filtering
% % % y2 = filter(b,a,x); % conventional filtering
% %
% % % plot(x,'k-.'); grid on ; hold on
% % % plot([y y2],'LineWidth',1.5);
% % plot(x,'r-')
% % hold all
% % plot(y,'b-')
% % legend('MAF','Zero-phase Filtering');
% T=ones(1,1)/2;
% y=filtfilt(T,1,p);
% subplot(6,1,1)
figure(1), plot(DatosExperimentales(:,1),'k'),xlim([0 504])
figure(2), plot(DatosExperimentales(:,2),'b'),xlim([0 504])
figure(3), plot(DatosExperimentales(:,3),'r'),xlim([0 504])
figure(4), plot(DatosExperimentales(:,4),'g'),xlim([0 504])
figure(5), plot(DatosExperimentales(:,5),'y'),xlim([0 504])
figure(6), plot(DatosExperimentales(:,6),'c'),xlim([0 504])
figure(7), plot(DatosExperimentales(:,7),'m'),xlim([0 504])
%Magnitudes Físicas
TPS=DatosExperimentales(:,8);
MAF=DatosExperimentales(:,9);
IAT=DatosExperimentales(:,10);
ECT=DatosExperimentales(:,11);
MAP=DatosExperimentales(:,12);
RPM=DatosExperimentales(:,6);
VSS=DatosExperimentales(:,7);
LT=DatosExperimentales(:,13);
%Graficas de dispersión
figure(8), plot(MAF,MAP,'r.')
title('MAF v.s. MAP')
xlabel('Mass Air Flow (g/s)')
ylabel('Measure Absolute Pressure (KPa)')
figure(8), plot(TPS,MAP,'r.')
title('TPS v.s. MAP')
xlabel('Throttle Position Sensor (%)')
ylabel('Measure Absolute Pressure (KPa)')
figure(8), plot(IAT,MAP,'b.')
title('IAT v.s. MAP')
xlabel('Intake Air Temperature (°C)')
ylabel('Measure Absolute Pressure (KPa)')
figure(8), plot(ECT,MAP,'r.')
title('ECT v.s. MAP')
xlabel('Engine Coolant Temperature (°C)')
ylabel('Measure Absolute Pressure (KPa)')
figure(8), plot(RPM,MAP,'r.')
title('RPM v.s. MAP')
xlabel('Revoluciones Por Minuto (r.p.m.)')
ylabel('Measure Absolute Pressure (KPa)')
% h=plotyy(LT,MAP,LT,MAF,LT,TPS), xlim([0 504])
subplot(2,3,1), plot(ECT,'m'),xlim([0 504])
subplot(2,3,2), plot(MAF,'c'),xlim([0 504])
subplot(2,3,3), plot(MAP,'b'),xlim([0 504])
subplot(2,3,4), plot(IAT,'y'),xlim([0 504])
subplot(2,3,5), plot(TPS,'g'),xlim([0 504])
subplot(2,3,6), plot(RPM,'r'),xlim([0 504])
subplot(2,3,1)
title('ECT')
xlabel('Tiempo (s)')
ylabel('Temperatura (°C)')
subplot(2,3,2)
title('MAF')
xlabel('Tiempo (s)')
ylabel('Flujo de aire (g/s)')
subplot(2,3,3)
title('MAP')
xlabel('Tiempo (s)')
ylabel('presión (KPa)')
subplot(2,3,4)
title('IAT')
xlabel('Tiempo (s)')
ylabel('Temperatura (°C)')
subplot(2,3,5)
title('TPS')
xlabel('Tiempo (s)')
ylabel('Porcentaje (%)')
subplot(2,3,6)
title('RPM')
xlabel('Tiempo (s)')
ylabel('revoluciones por minuto (r.p.m.')
% figure(1)
% plot(y(1:599),'r')
% % y1=filtfilt(T,1,y);
% % y2=filtfilt(T,1,y1);
% % y3=filtfilt(T,1,y2);
% % y4=filtfilt(T,1,y3);
% % y5=filtfilt(T,1,y4);
% % y6=filtfilt(T,1,y5);
% % subplot(6,1,2)
% % plot(y6)
% % y7=filtfilt(T,1,y6);
% % subplot(6,1,3)
% % plot(y7)
% % y8=filtfilt(T,1,y7);
% % subplot(6,1,4)
% % plot(y8)
% % y9=filtfilt(T,1,y8);
% % subplot(6,1,5)
% % plot(y9)
% % y10=filtfilt(T,1,y9);
% % subplot(6,1,6)
% % plot(y10)
% % %Resultado final, y10
% figure(2)
% plot(ainy(1:599,6),'b')
yyaxis left
plot(MAP)
yyaxis right
plot(MAF)
yyaxis left
plot(MAP)
yyaxis right
plot(TPS)
yyaxis left
plot(RPM)
yyaxis right
plot(TPS)