clc
s = serial('COM5');
time=100;
i=1;
Temp = zeros(99);
RelHumi = zeros(99);
while(i<time)
fopen(s);
fprintf(s, 'Your serial data goes here');
out = fscanf(s);
Temp(i)=str2double(out(1:4));
 subplot(211);
 plot(Temp,'m','LineWidth',1);
 axis([0,time,15,40]);
title('Parameter: DHT11 Temperature');
xlabel('---> time in x*0.02 sec');
ylabel('---> Temperature');
grid on
%
%
RelHumi(i)=str2double(out(5:9));
 subplot(212);
 plot(RelHumi,'b','LineWidth',1);
axis([0,time,10,60]);
title('Parameter: DHT11 Relative Humidity');
xlabel('---> time in x*0.02 sec');
ylabel('---> % of Relative Humidity ');
grid on

fclose(s);
i=i+1;
drawnow;
end
delete(s)
clear s

