solution8

# solution8 - Assignment#8 Prob 1 disp(a fprintf'volume = 12...

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

% Assignment #8 % Prob. 1 disp('(a)') fprintf('volume = 12 liters\ntemperature = 140 C\npressure = 170 kPa\n\n') disp('(b)') data=[1 12 140 170;2 6 80 90]'; fprintf('Sample %i: volume = %i liters, temperature = %i C, pressure = %i kPa\n',data) disp(' ') (a) volume = 12 liters temperature = 140 C pressure = 170 kPa (b) Sample 1: volume = 12 liters, temperature = 140 C, pressure = 170 kPa Sample 2: volume = 6 liters, temperature = 80 C, pressure = 90 kPa fprintf('Alternate solution\n') disp(' ') disp('(a)') data1=[12 140 170]'; fprintf('volume = %i liters\ntemperature = %i C\npressure = %i kPa\n\n',data1) disp('(b)') N=1:2; data2=[12 140 170;6 80 90]'; fprintf('Sample %i: volume = %i liters, temperature = %i C, pressure = %i kPa\n',[N;data2]) disp(' ') Alternate solution (a) volume = 12 liters temperature = 140 C pressure = 170 kPa (b) Sample 1: volume = 12 liters, temperature = 140 C, pressure = 170 kPa Sample 2: volume = 6 liters, temperature = 80 C, pressure = 90 kPa % prob 2 N=[12 140 170];

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

solution8 - Assignment#8 Prob 1 disp(a fprintf'volume = 12...

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

View Full Document
Ask a homework question - tutors are online