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
A torque T 5 3 kN ? m is applied to the solid bronze cylinder shown. Determine (a) the maximum shearing stress, (b) the shethe 1
Lelechka [254]

£¢π£¥¥¥£€€√¢•€€÷×¶£¥€✓©¥%¶×^€[{%¶∆{£]=¥✓=€

4 0
3 years ago
- Viscoelastic stress relaxation
My name is Ann [436]

Explanation:

The correct answers to the fill in the blanks would be;

1. Viscoelastic stress relaxation refers to scenarios for which the stress applied to a polymer must decay over time in order to maintain a constant strain. Otherwise, over time, the polymer chains will slip and slide past one another in response to a constant applied load and the strain will increase (in magnitude).

2. Viscoelastic creep refers to scenarios for which a polymer will permanently flow over time in response a constant applied stress.

The polymer whose properties have been mentioned above is commonly known as Kevlar.

It is mostly used in high-strength fabrics and its properties are because of several hydrogen bonds between polymer molecules.

5 0
3 years ago
Market research is a good place to start the design process and usually involves asking questions about consumers.
ElenaW [278]
what is your question?
4 0
3 years ago
The air in a room has a pressure of 1 atm, a dry-bulb temperature of 24C, and a wet-bulb temperature of 17C. Using the psychrome
TEA [102]

Answer:

(a) Relative Humidity = 48%,

Specific humidity = 0.0095

(b) Enthalpy = 65 KJ/Kg of dry sir

Specific volume = 0.86 m^3/Kg of dry air

(c/d) 12.78 degree C

(e) Specific volume = 0.86 m^3/Kg of dry air

8 0
3 years ago
When does the vc-turbo engine use lower compression ratios?.
Veronika [31]

Answer:

Explanation:

The VC-T engine (for "variable compression, turbocharged") can adjust its compression ratio between 8:1 and 14:1 on the fly, offering high-compression efficiency under light loads and the low compression needed for turbocharged power under hard acceleration.

7 0
2 years ago
Other questions:
  • Please Help It's really Important
    12·1 answer
  • Consider a two-dimensional incompressible velocity potential phi = ???????? cos theta + ????????theta, where B and L are constan
    8·1 answer
  • A long bone is subjected to a torsion test. Assume that the inner diameter is 0.375 in. and the outer diameter is 1.25 in., both
    14·1 answer
  • Crest is to high, as through is to
    12·2 answers
  • NASA SPACE SHUTTLE QUESTION:
    14·1 answer
  • Describe the algorithm you use for looking up a person’s telephone number in the phone book. The input is person’s name; the out
    9·2 answers
  • What are the benefits of using a multi view sketch to communicate a design
    14·1 answer
  • Which outcome most accurately portrays the future for the timber company in the following scenario?
    9·1 answer
  • Workplace bullying can cause_____hazards.
    7·1 answer
  • Raw materials used of silicone rubber
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!