Question: Subject: Computer Programming Q 1 : According to a dietician, a person should consume exactly 2 0 0 gm of carbohydrates, at least 1 7

Subject: Computer Programming
Q 1: According to a dietician, a person should consume exactly 200 gm of carbohydrates, at
least 175 gm of proteins and at most 150 gm of fats in a meal. The dietician also recommends
to have as much amount of vitamins as possible. The three food items that the person eats has
80,65 and 30 gm of carbohydrates per kilogram of food item. The same food items contain 10,
12,23 gm of proteins in each kilogram. Per kilogram of the same food items comprise of 32,
56 and 42 gm of fats. Vitamins contained in per kilogram of the same food items are 70,37
and 58 gm .
Determine how much kilogram of each food item the person should consume so as to have
maximum intake of vitamins by using appropriate built-in function present in MATLAB.
Q 2: The following data is obtained from an experiment aimed at measuring the spring constant
of a given spring. Different masses m are hung from the spring and the corresponding
deflections of the spring from its upstretched configuration are measured. From physics, we
know that F=k and here F=mg. Thus, we can find k from the relationship k=mg. Here,
however, we are going to find k by plotting the experimental data, fitting the best straight line
through the data, and then measuring the slope of the best-fit line.
Write the MATLAB script that shows the steps involved in making a straight line fit through
the given data in the spring experiment and finding the spring constant.
(Hint: use the polyfit and polyval function)
Q 3: Question:
In a coal-fired power plant, operating on Carnot Cycle, it is possible to set any value for the
temperature of boiler in which heat is added to water at high temperature (TH) and any value
for the temperature of condenser in which heat is rejected from steam at low temperature (TC),
from the following temperature list
T=[50032010007753856708451245410300627514]K
Being an operator of power plant you have to select TH and TC from the above temperature list
so that power plant operates at its highest efficiency.
Write a generalized MATLAB program to select two temperature values TH and TC for above
condition, without using min and max built-in function.
Print the maximum efficiency of cycle and the temperatures at which it occurs.
Subject: Computer Programming Q 1 : According to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!