Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
teb11007 committed Sep 13, 2017
1 parent c6d4316 commit 5b1db52
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -21,7 +21,7 @@ stdev of A_66 = 9.07
#Problem 4
```MATLAB
data=dlmread('US_energy_by_sector.csv',',',2,0);
figure(1)
h=figure();
plot(data(:,1),data(:,3),data(:,1),data(:,9));
set(0, 'defaultAxesFontSize', 16)
set(0,'defaultTextFontSize',14)
Expand All @@ -31,19 +31,19 @@ xlabel('Time (years)')
ylabel('Total Energy Consumed (trillions of BTUs)')
legend('Residential','Transportation','Location','northwest')
title('US Energy Consumption from 1949 to 2016')
saveas(h,'figure_01.png')
rescum=cumsum(data(:,3))./1000000;%cumulative sum of residential energy
rescum=cumsum(data(:,3))./1000000;%cumulative sum of residential energy
%consumption in quintillions
transcum=cumsum(data(:,9))./1000000;%cumulative sum of transportational
transcum=cumsum(data(:,9))./1000000;%cumulative sum of transportational
%energy consumption in quintillions
figure(2)
h=figure();
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')
saveas(h,'figure_02.png')
```
#Problem 5 (Velocity and Acceleration)

0 comments on commit 5b1db52

Please sign in to comment.