temps = 100 * rand(1, 50);
ColdCount = sum(temps <= 32);
CmftCount = sum(temps <= 70);
HotCount = sum(temps > 70);
subplot(2, 1, 1);
y = temps;
x = 1 : length(y);
plot(x, y, 'Marker', '^', 'Color', 'r', 'LineStyle', ':' ,'LineWidth', 2);
yline(32, 'LineWidth', 2, 'Color', 'b');
yline(70, 'LineWidth', 2, 'Color', 'b');
title('Temperature vs. Day', 'FontSize', 18);
xlabel('Day', 'FontSize', 18);
ylabel('Temperature', 'FontSize', 18);
grid on;
subplot(2, 1, 2);
c = categorical(["# of Cold Days","# of Comfortable Days", "# of Hot Days"]);
b = [ColdCount, CmftCount, HotCount];
bar(c, b);
ylabel('Count', 'FontSize', 18);
grid on;