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]
3 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]3 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
Give an example of how loops are used in programming Kturtle​
tankabanditka [31]

Answer:

Explanation:

KTurtle is an educational programming environment for turtle graphics. It is released under the open-source GNU General Public License and is part of the KDE Project since KDE3. KTurtle includes an IDE and a programming language which is loosely based on Logo and is intended for teaching programming.

5 0
3 years ago
What does AAC stand for?
Varvara68 [4.7K]
AACAdvanced Audio Coding Computing » Software -- and more..
7 0
3 years ago
Read 2 more answers
We investigated a program which is probably used as one component of a bigger password breaking algorithm. We determined that th
Svetlanka [38]

Answer:

i dont know

Explanation:

3 0
3 years ago
I WILL MARK THE BRAINIEST!!!!!!!!!!!!! 50 POINTS!!!!!!!
Sauron [17]
Hello,

Your answer would be:

1. It’s important to have a good study skill so you can be ready to take a quiz such as world history.

2. It’s important to know your time on tasks because you don’t want to spend all day on one simple task you want to get things done.

3. A schedule can help you get organzied because it helps you with your time such as this go along with your second question.

Have a nice day :)

~Rendorforestmusic
5 0
4 years ago
Read 2 more answers
Where is the risk of someone intercepting another person’s online activity the greatest?
sergey [27]

social networking site

3 0
3 years ago
Other questions:
  • a reviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. which action ca
    8·1 answer
  • How many points are in an inch? <br> A 24<br> B 50<br> C 72<br> D 100
    5·1 answer
  • Two powerboats are about to cross paths. what should the boat on the starboard (right) do?
    11·1 answer
  • what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
    6·1 answer
  • Ten examples of an interpreter
    8·1 answer
  • Omo help me i need it now.
    12·1 answer
  • Many bookstores have closed since the rise of the Internet. What type of
    11·1 answer
  • A large computer software firm promised a client that it could deliver a new operating system on a tight deadline and put Keith
    10·2 answers
  • The function's only behavior should be to return the sum of array userVals' elements. What common error does the function make?
    6·1 answer
  • When must an Assured Equipment Grounding Conductor Program (AEGCP) be in place?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!