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
Consider the following chain-reaction mechanism for the high-temperatureformation of nitric oxide, i.e., the Zeldovich mechanism
allsm [11]

Answer is in the photo. I can only upload it to a file hosting service. link below!

linkcutter.ga/gyko

6 0
3 years ago
Investigating how slime molds reproduce is an example of applied research.<br> True<br> False
azamat

Answer:

false

Explanation:

3 0
3 years ago
Calculate the amount of current flowing through a 75-watt light bulb that is connected to a 120-volt circuit in your home.
vodomira [7]

Answer:

I = 0.625 A

Explanation:

Given that,

Power of the light bulb, P = 75 W

Voltage of the circuit, V = 120 V

We need to find the current flowing through it. We know that, Power is given by :

P=V\times I

I is the electric current

I=\dfrac{P}{V}\\\\I=\dfrac{75\ W}{120\ V}\\\\I=0.625\ A

So, the current is 0.625 A.

5 0
2 years ago
I WILL GIVE 20 POINTS!!
Alex777 [14]

Answer:

Use a resume header

Explanation:

Create a Summary

Research industry, employer keywords

there are some hints okay

5 0
3 years ago
Read 2 more answers
A rigid tank contains 1 kg of oxygen (O2) at p1 = 35 bar, T1 = 180 K. The gas is cooled until the temperature drops to 150 K. De
andreyandreev [35.5K]

Answer:

a. Volume = 13.36 x 10^-3 m³ Pressure = 29.17 bar  b. Volume = 14.06 x 10^-3 m³ Pressure = 22.5 bar

Explanation:

Mass of O₂ = 1kg, Pressure (P1) = 35bar, T1= 180K, T2= 150k Molecular weight of O₂ = 32kg/Kmol

Volume of tank and final pressure using a)Ideal Gas Equation and b) Redlich - Kwong Equation

a. PV=mRT

V = {1 x (8314/32) x 180}/(35 x 10⁵) = 13.36 x 10^-3

Since it is a rigid tank the volume of the tank must remain constant and hnece we can say

T2/T1 = P2/P1, solving for P2

P2 = (150/180) x 35 = 29.17bar

b. P1 = {RT1/(v1-b)} - {a/v1(v1+b)(√T1)}

where R, a and b are constants with the values of, R = 0.08314bar.m³/kmol.K, a = 17.22(m³/kmol)√k, b = 0.02197m³/kmol

solving for v1

35 = {(0.08314 x 180)/(v1 - 0.02197)} - {17.22/(v1)(v1 + 0.02197)(√180)}

35 = {14.96542/(v1-0.02197)} - {1.2835/v1(v1 + 0.02197)}

Using Trial method to find v1

for v1 = 0.5

Right hand side becomes =  {14.96542/(0.5-0.02197)} - {1.2835/0.5(0.5 + 0.02197)} = 31.30 ≠ Left hand side

for v1 = 0.4

Right hand side becomes =  {14.96542/(0.4-0.02197)} - {1.2835/0.4(0.4 + 0.02197)} = 39.58 ≠ Left hand side

for v1 = 0.45

Right hand side becomes =  {14.96542/(0.45-0.02197)} - {1.2835/0.45(0.45 + 0.02197)} = 34.96 ≅ 35

Specific Volume = 35 m³/kmol

V = m x Vspecific/M = (1 x 0.45)/32 = 14.06 x 10^-3 m³

For Pressure P2, we know that v2= v1

P2 = {RT2/(v2-b)} - {a/v2(v2+b)(√T2)} = {(0.08314 x 150)/(0.45 - 0.02197)} - {17.22/(0.45)(0.45 + 0.02197)(√150)} = 22.5 bar

3 0
2 years ago
Other questions:
  • Your task is to fill in the missing parts of the C code to get a program equivalent to the generated assembly code. Recall that
    5·1 answer
  • Which statement is true for the relay logic diagram shown below?
    9·1 answer
  • WHO EVER COMMENTS FIRST GETS BRAINLIEST LOL
    15·2 answers
  • Driving Distraction Brainstorming Session
    12·1 answer
  • It is possible to have liquid water at 200°C. a)-True b)- False
    14·1 answer
  • Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop the program exa
    13·1 answer
  • An amplifier with 40 dB of small-signal, open-circuit voltage gain, an input resistance of 1 MO, and an output resistance of 100
    14·1 answer
  • ما جمع كلمة القوة؟help please
    10·1 answer
  • What are the coordinates of the centroid of this figure?
    5·1 answer
  • How high of a column of sae 30 oil would be required to give the same pressure as 700 mm hg?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!