1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leya [2.2K]
2 years ago
12

Create a vector of structures experiments that stores information on subjects used in an experiment. Each struct has four fields

: ID, name, weights, and height. The field ID is an integer, name is a string, weights are a vector with two values in pounds (both of which are double values), and height is a struct with fields feet and inches (both of which are integers). The following is an example of what the format might look like.
Experiments
ID Name Weights Height (feet) Icnhes
1 2
1 1111 Bob 150.1 149.6 6 1
2 2222 Ann 106.2 106.6 5 3

Write a function printhheight that will receive a vector of structures in this format and will print the name, ID and height of each subject in inches (1 foot = 12 inches). This function calls another function height that receives a height struct and returns the total height in inches. This function could also be called separately.
Computers and Technology
1 answer:
ella [17]2 years ago
7 0

Answer:

im assuming this is required to be done in matlabs.

Explanation:

experiment.m

% Create an "experiments" vector of structures

% variable, and pass it to a function that will

% print the height of each subject

experiments(2) = struct('ID', 2222); 'name'; 'Ann'; ...  

   'weights'; '106.2, 106.6.9'; 'height'; struct('feet',5, 'inches',3);

experiments(1) = struct('ID',1111);'name'; 'Bob'; ...  

'weights'; '150.1, 149.6'; 'height'; ...

struct('feet', 6, 'inches', 1);

printhheight(experiments)

printhheight.m

function printhheight(experiments)

% Prints height of every subject

% Format of call: prinths(experiments vector)

% Does not return any values

for i = 1 : length(experiments), high = height(experiments(i)*height);

fprintf('%s is %d inches tall\n', ...

     experiments(i).name, high)

end

end

height.m

function ht = height(expstruct)

% Calculates height in inches of a subject

% Format of call: height(experiment struct)

% Returns height in inches

ht = expstruct.feet*12+expstruct.inches;

end

You might be interested in
You may see the term FAQ on websites which stands for Frequently Asked Questions this is an example of which type of mnemonic?
babymother [125]
The first question is B.), acronym, and the second one is c.) acrostic.
Hope this helps!
6 0
3 years ago
Can someone please please please help me!
vova2212 [387]
Is that apologetics?

5 0
3 years ago
The data set monarch from Computer-Active Data Analysis by Lunn andMcNeil (1991) contains the years lived after inauguration,ele
gulaghasi [49]

Answer:

0.033

Explanation:

Please kindly check attachment for the step by step solution of the given problem.

5 0
3 years ago
What type of device is characteristic of an enterprise environment?
Nitella [24]
A workstation used at an engineering firm.
8 0
3 years ago
Which of the following is the best reason to use a macro?: *
marin [14]

Answer:c)You want to automate a repetitive task to save time

Explanation: Macro is the program that is utilized when there is a requirement of a task or operation to be repeated in a automatic way.This helps in saving the time without commanding the same operation to take place manually.

This program works by taking the into and generating the preset output sequence. Other options are incorrect because it does not help in email functions, correction of the citation in documents or generation of the table.Thus, the correct option is option(c).

7 0
3 years ago
Other questions:
  • Create an integer variable named ‘listSize’ and initialize the value to 1000.
    5·1 answer
  • Can somebody explain me what this code does in a few or one sentence?#include #include using namespace std;int main () { const i
    12·1 answer
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    7·1 answer
  • The process known as "bitmapping" is defined as information in _____. PLEASE HELP FAST
    11·1 answer
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • How do you change your name on your brainly profile
    14·2 answers
  • Rewrite the Espresso Counter program to Swap or interchange any two rows of the output. Copy and paste just the interchanged par
    14·1 answer
  • What are the two most common input and output devices?
    6·2 answers
  • A small square at the right corner of the table is what?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!