6.8.1: Selecting steam table data using relational operators. This actwity uses
ID: 3786728 • Letter: 6
Question
6.8.1: Selecting steam table data using relational operators. This actwity uses a 3rd party app. Though your activity may be recorded arefesh may be required to update the banner to the left. Selecting steam table data using relational operators. 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 155, 0.1576, 9.568, 2450.1; 60, 0.1994, 7.671, 2456 61 Save C Reset MATLAB Documentation Your Solution 1 function selectedData Get Steam Table Data( loTemp, hiTemp 2 Select LogicalN: Return rows of the steam table data between input 3 low and high temperatures 4 Inputs: Tempo, hiTemp input low and high temperatures for indexing rows of steam table 7 Outputs selected Data returned rows of steam table data between low and high temperatures steamTable: first column is temperature (Celsius) steam Table 5e, e. 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; 15 Assign tempData with first column of steamTable data tempData steamTable FIXMEExplanation / Answer
The Function GetStramTableData.m
function selectedData = GetStramTableData(loTemp,hiTemp)
% Help commants here
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; ]; % The steam table as given
% Assign tempData with first colum of steamTable data
tempData = steamTable(:,1);
% Assign selectedTemps with logical column array of
% temperature between lotemp and hiTemp
selectedTemps = (tempData>loTemp) & (tempData<hiTemp);
% Assign selectedData with specified rows of steamTable
selectedData = steamTable(selectedTemps.*[1:4]'~=0,:);
end
OUTPUT
>> GetStramTableData(54,64)
ans =
1.0e+03 *
0.0550 0.0002 0.0096 2.4501
0.0600 0.0002 0.0077 2.4566
>> GetStramTableData(0,52)
ans =
1.0e+03 *
0.0500 0.0001 0.0120 2.4435
>> GetStramTableData(50,70)
ans =
1.0e+03 *
0.0550 0.0002 0.0096 2.4501
0.0600 0.0002 0.0077 2.4566
0.0650 0.0003 0.0062 2.4631
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.