Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Matlab The first column of matrix steamTable indicates the temperature of water in Celsius. The remaining colums indicate the thermodynamic properties of water at

Use Matlab

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 )

% SelectLogicalN: Return rows of the steam table data between input

% low and high temperatures..

% Inputs: loTemp, hiTemp - input low and high temperatures for

% indexing rows of steam table

%

% Outputs: selectedData - returned rows of steam table data

% between low and high temperatures

% steamTable: first column is temperature (Celsius)

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; ];

% Assign tempData with first column of steamTable data

tempData = steamTable; % FIXME

% Assign selectedTemps with logical column array of

% temperatures between loTemp and hiTeamp

selectedTemps = [ true; true; true; true; ]; % FIXME

% Assign selectedData with specified rows of steamTable (Hint:

% use row-column indexing and the colon operator)

selectedData = steamTable; % FIXME

end

Code to call your function:

GetSteamTableData(54, 64)

Check if GetSteamTableData(54, 64) returns [ 55, 0.1576, 9.568, 2450.1; 60, 0.1994, 7.671, 2456.6; ].

Check if GetSteamTableData(0, 52) returns [ 50, 0.1235, 12.032, 2443.5; ].

Check if GetSteamTableData(50, 70) returns [ 55, 0.1576, 9.568, 2450.1; 60, 0.1994, 7.671, 2456.6; 65, 0.2503, 6.197, 2463.1;].

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago