Problem:
The first column of matrix steamTable indicates the temperature of water in Celsius. The remaining colums indicate the thermodynamic properties of water at the specified temperature. Assign selectedData with all rows of steamTable that correspond to temperatures greater than loTemp and less than hiTemp.
Ex: If loTemp is 54 and hiTemp is 64, then selectedData is [55, 0.1576, 9.568, 2450.1; 60, 0.1994, 7.671, 2456.6;].
function selectedData = GetSteamTableData( loTemp, hiTemp )
steamTable = [ 50, 0.1235, 12.032, 2443.5;
55, 0.1576, 9.568, 2450.1;
60, 0.1994, 7.671, 2456.6;
65, 0.2503, 6.197, 2463.1; ];
tempData = steamTable(:,1);
selectedTemps = (tempData >= loTemp) & (tempData < hiTemp) ;
selectedData = steamTable(selectedTemps,:);
end
and for some reason it always outputs this. Where is the 1.0e+03 coming from?
ans =
1.0e+03 *
0.0550 0.0002 0.0096 2.4501
0.0600 0.0002 0.0077 2.4566
0 Comments
Sign in to comment.