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
Ganezh [65]
3 years ago
8

Write a function separatethem that will receive one input argument which is a structure containing fields named length and width

, and will return the two values separately. Here is an example of calling the function >> myrectangle = struct('length',33,'width',2); You just created a structure myrectangle with the above line of code. Now, if you send myrectangle into separatethem function, it should access the length and width fields and store it in output variables l and w (Again, no tips or tricks! do not overthink on this one. Just access the fields length and width from myrectangle input argument and store it in output variables l and w >> [l w] = separatethem(myrectangle) l = 33 w = 2
Engineering
1 answer:
SpyIntel [72]3 years ago
6 0

Answer:

%seperatethem.m

%Creation and definition of functions

function [l w] = separatethem(myrectangle)

%Call the structure field length.

l = myrectangle.length(1);

%Call the structure field length.

w = myrectangle.width(1);

%Ending call function.

end

%trial of program

%Create a structure with two fields length and width.

myrectangle = struct('length',33,'width',2);

%Call the function separate them.

[l w] = separatethem(myrectangle)

You might be interested in
Why does my delivery date keep changing on my tesla model 3
telo118 [61]
Because i stole it lol
5 0
3 years ago
Teachers
IRINA_888 [86]
Uh I’m just gonna say yes because I think this is just something random
5 0
3 years ago
The flow rate in the pipe system below is 0.05 m3/s. The pressure at point 1 is measured to be 260 kPa. Point 1 is 0.60 m higher
DedPeter [7]

Answer:

Explanation:

The rate of flow in the pipe system in Figure P4.5.2 is 0.05 m3/s. The pressure at point 1 is measured to be 260 kPa. All the pipes are galvanized iron with roughness value of 0.15 mm. Determine the pressure at point 2. Take the loss coefficient for the sudden contraction as 0.05 and v = 1.141 × 10−6 m2/s.

The answer to the above question is

The pressure at point 2 = 75.959 kPa

Explanation:

Bernoulli's equation with losses gives

hL = z₁ - z₃ +(P₁-P₃)/(ρ×g) + (v₁²-v₃²)/(2×g)

Between points 1 and 2, z₁ = z₃ + 0.6 m therefore

hL = 0.6 m +(P₁-P₂)/(ρ×g) + (v₁²-v₃²)/(2×g)

hL = (f₁×L₁×v₁²)/(D₁×2×g) + (f₂×L₂×v₂²)/(D₂×2×g) + (f₃×L₃×v₃²)/(D₃×2×g) + k×V₃₂/(2×g) = 0.6 +(P₁-P₂)/(ρ×g) + (v₁²-v₃²)/(2×g)

But v = Q/A

or  since A = π×D²/4 we have

A₁ = 1.77×10-2 m² , A₂ = 5.73×10-2 m², A₃ = 3.8×10-2 m²  

Therefore from v = Q/A we have v₁ = 2.83 m/s v₂ = 0.87 m/s and v₃  = 1.315 m/s  from there we find the friction coefficient from Moody Diagram as follows

ε = \frac{Roughness _. value}{ Diameter} Which gives

the friction coefficients as f₁ = 0.02, f₂ = 0.017 and f₃ =0.0175

Substituting he above values into the h_{l} equation we get h_{l} = 19.761 m

Combined head loss = 19.761 m

Hence 19.743 m  = 0.6 m +(260 kPa-P₃)/(ρ×9.81) + (6.276)/(2×9.81)

or 260 kPa-18.82 m × 9.81 m/s²×ρ=  P₃

Where ρ = density of water, we have

260000 Pa - 18.82 m×9.81 m/s²×997 kg/m³ = 75958.598 kg/m·s² = 75.959 kPa

6 0
3 years ago
Oil with a kinematic viscosity of 4 10 6 m2 /s fl ows through a smooth pipe 12 cm in diameter at 2.3 m/s. What velocity should w
Setler79 [48]

Answer:

Velocity of 5 cm diameter pipe is 1.38 m/s

Explanation:

Use following equation of Relation between the Reynolds numbers of both pipes

Re_{5} = Re_{12}

\sqrt{\frac{V_{5}XD_{5}  }{v_{5}}}= \sqrt{\frac{V_{12}XD_{12}  }{v_{12}}}

Re_{5} = Reynold number of water pipe

Re_{12} = Reynold number of oil pipe

V_{5} = Velocity of water 5 diameter pipe = ?

V_{12} = Velocity of oil 12 diameter pipe = 2.30

v_{5} = Kinetic Viscosity of water = 1 x 10^{-6} m^{2}/s

v_{12} = Kinetic Viscosity of oil =  4 x 10^{-6} m^{2}/s

D_{5} = Diameter of pipe used for water = 0.05 m

D_{12} = Diameter of pipe used for oil = 0.12 m

Use the formula

\sqrt{\frac{V_{5}XD_{5}  }{v_{5}}}= \sqrt{\frac{V_{12}XD_{12}  }{v_{12}}}

By Removing square rots on both sides

{\frac{V_{5}XD_{5}  }{v_{5}}}= {\frac{V_{12}XD_{12}  }{v_{12}}}

{V_{5}= {\frac{V_{12}XD_{12}  }{v_{12}XD_{5}\\}}xv_{5}

{V_{5}= [ (0.23 x 0.12m ) / (4 x 10^{-6} m^{2}/s) x 0.05 ] 1 x 10^{-6} m^{2}/s

{V_{5} = 1.38 m/s

4 0
3 years ago
A Medical Bioengineering student is tasked with performing signal analysis.
inna [77]

Answer: I will ask my dad he knows

Explanation:

7 0
4 years ago
Other questions:
  • When the desired section has been cut out and is not seen elsewhere on the drawing, a(n) ____is being used.
    15·1 answer
  • Column arrays: Transpose a row array Construct a row array countValues with elements 1 to endValue, using the double colon opera
    6·1 answer
  • What is the specific volume of oxygen at 40 psia and 80°F?
    10·1 answer
  • Strong performance in your engineering discipline ordinarily is one necessary condition for becoming a successful engineering ma
    7·1 answer
  • To increase fault-tolerance, the security administrator for Corp has installed an active/passive firewall cluster where the seco
    11·1 answer
  • An insulated mixing chamber receives 0.5 kg/s of steam at 3 MPa and 300°C through one inlet, and saturated liquid water at 3 MPa
    12·1 answer
  • The practice of honoring those who have been lost in battle dates back to which two ancient
    13·2 answers
  • 100000000000x1000000000000=?
    14·2 answers
  • When servicing piston rods and pins it is important to always
    12·2 answers
  • Design a driver circuit that should drive a a seven segment to display octal numbers
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!