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
Schach [20]
3 years ago
15

Create a separate function file fieldtovar.m that receives a single structure as an input and assigns each of the field values t

o user-defined variables. The function should work for a structure with any number of fields. Additionally, implement an error check to ensure that the number of userdefined variables (output arguments) is equal to the number of structure fields.
Engineering
1 answer:
Soloha48 [4]3 years ago
4 0

Answer:

Explanation gives the answer

Explanation:

% Using MATLAB,

% Matlab file : fieldtovar.m

function varargout = fieldtovar(S)

% function that accepts single structure as input, assigning each

% of the field values to user-defined variables

fields = fieldnames(S); % get the field names of the input structure

% check if number of user-defined variables and number of fields in

% structure are equal

if nargout == length(fields)

% if equal assign each value of structure to user-defined varable

for i=1:nargout

varargout{i} = getfield(S,fields{i});

end

else

% if not equal display an error message

error('The number of output variables does not equal the number of fields');

end

end

%This brings an end to the program

You might be interested in
List five areas that increased energy prices impact.
Effectus [21]

Answer:

Supply, demand, global markets, imports and exports, and government Regulation.

Explanation:

7 0
3 years ago
Give me source code of Simple openGL project. ( without 3D or Animation) simple just.
Ivan

Answer:

Use GitHub or stackoverflow for this answer

Explanation:

It helps with programming a lot

4 0
3 years ago
Explain how use of EGR is effective in reducing NOx emissions 4. In most locations throughout the U.S., the octane number of reg
TiliK225 [7]

Answer:please see attached file

Explanation:

3 0
4 years ago
A 1020 CD steel shaft is to transmit 15 kW while rotating at 1750 rpm. Determine the minimum diameter for the shaft to provide a
vladimir2022 [97]

Answer:

diameter is 14 mm

Explanation:

given data

power = 15 kW

rotation N = 1750 rpm

factor of safety = 3

to find out

minimum diameter

solution

we will apply here power formula to find T that is

power = 2π×N×T / 60    .................1

put here value

15 ×10^{3} = 2π×1750×T / 60

so

T = 81.84 Nm

and

torsion = T / Z                        ..........2

here Z is section modulus i.e = πd³/ 16

so from equation 2

torsion = 81.84 / πd³/ 16

so torsion = 416.75 / / d³     .................3

so from shear stress theory

torsion = σy / factor of safety

so here σy = 530 for 1020 steel

so

torsion = σy / factor of safety

416.75 / d³ = 530 × 10^{6} / 3

so d = 0.0133 m

so diameter is 14 mm

3 0
3 years ago
How much does 5 acres of land cost in the US?
Dvinal [7]

Answer:

Larson, an economist, who placed the total value of $23 trillion for the entire 1.9 billion acres of land in the United States. This means that the average cost for an acre of land is $12,000 or $60,000 for 5 acres of land. Almost half of the land in the US is used for agricultural purposes.

Explanation:

6 0
4 years ago
Other questions:
  • Suppose a possibly biased die is rolled 30 times and that the face containing
    13·1 answer
  • The development team recently moved a new application into production for the accounting department. After this occurred, the Ch
    6·1 answer
  • Thermosetting polymers are polymers that becomes soft and pliable when heated. ( True , False )
    8·2 answers
  • A fuel cell vehicle draws 50 kW of power at 70 mph and is 40% efficient at rated power. You are asked to size the fuel cell syst
    15·1 answer
  • You are considering building a residential wind power system to produce 6,000 kWh of electricity each year. The installed cost o
    15·1 answer
  • The human body gets its energy via the combustion of blood sugar (glucose). if all of the chemical bond energy in 10 g of glucos
    9·1 answer
  • I'm really bad at measurements so I don't understand this.
    12·1 answer
  • Calculate the radius of a circular orbit for which the period is 1 day​
    13·1 answer
  • How many buttons in an airbus a380 cockpit
    9·2 answers
  • The section should span between 10.9 and 13.4 cm (4.30 and 5.30 inches) as measured from the end supports and should be able to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!