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
An air compressor of mass 120 kg is mounted on an elastic foundation. It has been observed that, when a harmonic force of amplit
kupik [55]

Answer:

equivalent stiffness is 136906.78 N/m

damping constant is 718.96 N.s/m

Explanation:

given data

mass = 120 kg

amplitude = 120 N

frequency = 320 r/min

displacement = 5 mm

to find out

equivalent stiffness and damping

solution

we will apply here frequency formula that is

frequency ω = ω(n) √(1-∈ ²)      ......................1

here  ω(n) is natural frequency i.e = √(k/m)

so from equation 1

320×2π/60 = √(k/120) × √(1-2∈²)

k × ( 1 - 2∈²) = 33.51² ×120

k × ( 1 - 2∈²) = 134752.99    .....................2

and here amplitude ( max ) of displacement is express as

displacement = force / k  ×  (  \frac{1}{2\varepsilon \sqrt{1-\varepsilon ^2}})

put here value

0.005 = 120/k   ×  (  \frac{1}{2\varepsilon \sqrt{1-\varepsilon ^2}})  

k ×∈ × √(1-2∈²) = 1200       ......................3

so by equation 3 and 2

\frac{k\varepsilon \sqrt{1-\varepsilon^2})}{k(1-2\varepsilon^2)} = \frac{12000}{134752.99}

\varepsilon^{2} - \varepsilon^{4}  = 7.929 * 10^{-3} - 0.01585 * \varepsilon^{2}

solve it and we get

∈ = 1.00396

and

∈ = 0.08869

here small value we will consider so

by equation 2 we get

k × ( 1 - 2(0.08869)²) = 134752.99

k  = 136906.78 N/m

so equivalent stiffness is 136906.78 N/m

and

damping is express as

damping = 2∈ √(mk)

put here all value

damping = 2(0.08869) √(120×136906.78)

so damping constant is 718.96 N.s/m

7 0
3 years ago
Hi,I want to know something.
Paha777 [63]

Answer:

So it looks to me that, Yes, you can find 10-50 leds on Amazon. You just have to be specific and search 10-50 led Christmas lights for windows, or something along those lines. Also try filtering the results, and reading the descriptions and reviews. This should help you out, and if it doesn't then I'm sorry.

Good luck friend :)

8 0
3 years ago
In order to protect yourself if you have a dispute with another drivers insurance company you should:
klio [65]

Answer:

  C. Get the names and addresses of witness to the crash

Explanation:

The best approach is to let your insurance company handle the dispute. Since that is not an option here, the best thing you can do is make sure you know who the witnesses are, so your insurance company can call upon them as needed.

8 0
3 years ago
Steam enters an adiabatic condenser (heat exchanger) at a mass flow rate of 5.55 kg/s where it condensed to saturated liquid wat
Evgen [1.6K]

Answer:

The minimum mass flow rate will be "330 kg/s".

Explanation:

Given:

For steam,

m_{s}=5.55 \ kg/s

\Delta h=2491 \ kg/kj

For water,

\Delta T=10^{\circ}C

(Cp)_{w}=4.184 \ kJ/kg^{\circ}C

They add energy efficiency as condenser becomes adiabatic, with total mass flow rate of minimal vapor,

⇒  m_{s}\times (\Delta h)=M_{w}\times(Cp)_{w}\times \Delta T

On putting the estimated values, we get

⇒  5.55\times 2491=M_{w}\times 4.184\times 10\\

⇒  13825.05=M_{w}\times 41.84

⇒  M_{w}=330 \ kg/s

7 0
3 years ago
Pipe Diameter and Reynolds Number. An oil is being pumped inside a 10.0-mm-diameter pipe at a Reynolds number of 2100. The oil d
alexdok [17]

Answer:

The velocity in the pipe is 5.16m/s. The pipe diameter for the second fluid should be 6.6 mm.

Explanation:

Here the first think you have to consider is the definition of the Reynolds number (Re) for flows in pipes. Rugly speaking, the Reynolds number is an adimensonal parameter to know if the fliud flow is in laminar or turbulent regime. The equation to calculate this number is:

Re=\frac{\rho v D}{\mu}

where \rhois the density of the fluid, \mu is the viscosity, D is the pipe diameter and v is the velocity of the fluid.

Now, we know that Re=2100. So the velocity is:

v=\frac{Re*\mu}{\rho*D} =\frac{2100*2.1x10^{-2}Pa*s }{855kg/m^3*0.01m} =5.16m/s

For the second fluid, we want to keep the Re=2100 and v=5.16m/s. Therefore, using the equation of Reynolds number the diameter is:

D=\frac{Re*\mu}{\rho*v} =\frac{2100*1.5x10^{-2}Pa*s}{925kg/m^3*5.16m/s}=6.6 mm

8 0
3 years ago
Other questions:
  • ): drivers must slow down from 60 to 40 mi/hr to negotiate a severe curve. A warning sign is visible for a distance of 120 ft. H
    7·1 answer
  • Once a design is final engineer needs a plan for product
    14·1 answer
  • How do batteries and other types of power sources make physical computing systems more mobile?
    15·2 answers
  • At the grocery store you place a pumpkin with a mass of 12.5 lb on the produce spring scale. The spring in the scale operates su
    5·1 answer
  • The lattice constant of a simple cubic primitive cell is 5.28 Å. Determine the distancebetween the nearest parallel ( a ) (100),
    13·1 answer
  • An eddy current separator is to separate aluminum product from an input streamshredded MSW. The feed rate to the separator is 2,
    7·1 answer
  • The convection heat transfer coefficient for a clothed person standing in moving air is expressed as h 5 14.8V0.69 for 0.15 , V
    6·2 answers
  • It is the tool used to measure the amount of electric current​
    6·2 answers
  • an oven takes 15A at 240V,it required to reduce current to 12V find resistance which must be connected in series​
    15·1 answer
  • Importance of tillage​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!