Skip to content
Permalink
e30a92d6f1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
51 lines (47 sloc) 1.93 KB
<<<<<<< HEAD
data=dlmread('US_energy_by_sector.csv',',',2,0);
figure(1)
plot(data(:,1),data(:,3),data(:,1),data(:,9));
set(0, 'defaultAxesFontSize', 16)
set(0,'defaultTextFontSize',14)
set(0,'defaultLineLineWidth',3)
set(gcf, 'Position', [200, 200, 1000, 800])
xlabel('Time (years)')
ylabel('Total Energy Consumed (trillions of BTUs)')
legend('Residential','Transportation','Location','northwest')
title('US Energy Consumption from 1949 to 2016')
rescum=cumsum(data(:,3))./1000000;%cumulative sum of residential energy
%consumption in quintillions
transcum=cumsum(data(:,9))./1000000;%cumulative sum of transportational
%energy consumption in quintillions
figure(2)
plot(data(:,1),rescum,data(:,1),transcum)
set(gcf, 'Position', [500, 200, 1000, 800])
xlabel('Time (years)')
ylabel('Total Energy Consumed (quintillions of BTUs)')
legend('Residential','Transportation','Location','northwest')
title('Cumulative US Energy Consumption from 1949 to 2016')
=======
data=dlmread('US_energy_by_sector.csv',',',2,0);
figure(1)
plot(data(:,1),data(:,3),data(:,1),data(:,9));
set(0, 'defaultAxesFontSize', 16)
set(0,'defaultTextFontSize',14)
set(0,'defaultLineLineWidth',3)
set(gcf, 'Position', [200, 200, 1000, 800])
xlabel('Time (years)')
ylabel('Total Energy Consumed (trillions of BTUs)')
legend('Residential','Transportation','Location','northwest')
title('US Energy Consumption from 1949 to 2016')
rescum=cumsum(data(:,3))./1000000;%cumulative sum of residential energy
%consumption in quintillions
transcum=cumsum(data(:,9))./1000000;%cumulative sum of transportational
%energy consumption in quintillions
figure(2)
plot(data(:,1),rescum,data(:,1),transcum)
set(gcf, 'Position', [500, 200, 1000, 800])
xlabel('Time (years)')
ylabel('Total Energy Consumed (quintillions of BTUs)')
legend('Residential','Transportation','Location','northwest')
title('Cumulative US Energy Consumption from 1949 to 2016')
>>>>>>> 91d61e3e4b17400ee1c842feddcb5f3ad25e1994