HW_3_Solution - HOMEWORK SOLUTION#3 1 The following code is...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1) The following code is written in a script file. fid=fopen( 'McClean_Bowman.txt' , 'rt' ); headings1=fgetl(fid); headings2=fgetl(fid); headings3=fgetl(fid); headings4=fgetl(fid); headings5=fgetl(fid); d=fscanf(fid, '%f' ); d=reshape(d,[6 39])' year=d(:,1); gas=d(:,2); oil=d(:,3); plot(year,gas, '.-' ,year,oil, 'o:' ) grid on ; title( 'Oil and gas production versus year' ); xlabel( 'Year' ); ylabel( 'Oil production(BBL) and Gas production(MCF)' ); legend( '.-gas production' , 'o-oil production' ); axis([1970 2010 0 400000]); Outputs: d = 1.0e+005 * Columns 1 through 4 0.019700000000000 0.002670000000000 0.005770000000000 0.000087800000000 0.019710000000000 1.176490000000000 2.614500000000000 0.000153600000000 0.019720000000000 1.032940000000000 1.971620000000000 0.000188800000000 0.019730000000000 1.614430000000000 2.161210000000000 0.000340400000000 0.019740000000000 1.127710000000000 1.676260000000000 0.000118900000000 0.019750000000000 1.684270000000000 1.294900000000000 0.000355200000000 0.019760000000000 1.564650000000000 1.096300000000000 0.000329900000000 0.019770000000000 1.444590000000000 0.967880000000000 0.000304600000000 0.019780000000000 1.406560000000000 0.856520000000000 0.000296600000000 0.019790000000000 0.983840000000000
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2011 for the course PGE 310 taught by Professor Klaus during the Spring '06 term at University of Texas.

Page1 / 6

HW_3_Solution - HOMEWORK SOLUTION#3 1 The following code is...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online