clc
clear 
%% import EV charing load/demand
evTmp = load ('EVload.txt'); % import the EV charging demand per minutes
evTmp = evTmp'; % transpose so that each column contains the ev load in minutes resolution

%% get the hourly charging load of the EVs
ev_apart = reshape(evTmp,[],24*20); % has 60 rows represent 60 minutes
ev_hour_row = mean(ev_apart,1); % get the mean of each column, which represents hourly load 
ev_hourly = reshape(ev_hour_row,24,20); % now each column has hourly load of a EV

%% import price data
pri = load('price2014_2.txt'); % 365_day*24_hr
pri_hourly = pri(190,:); % we use the price in the first day of 2014
plot(pri_hourly,'o')

%% get a nicer plot of price signal, we need price per minutes
pri_min = reshape(repmat(pri_hourly,60,1),1440,1); % price per minutes
figure
plot(pri_min)

%% make your plot look nicer
timelabel={'0','4','8','12','16','20','24'};
fs =10;
xlabel('Time','fontsize',fs,'FontName','Times New Roman');
ylabel('Price ($/MWh)','fontsize',fs,'FontName','Times New Roman');
set(gca,'xtick',0:240:1440,'xticklabel',timelabel,'fontsize',fs,'FontName','Times New Roman');
set(gca,'ytick',0:50:300,'fontsize',fs,'FontName','Times New Roman');
axis([0 1440 0 150]);

grid on

