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
Naily [24]
3 years ago
13

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

mines each element of the vector. If the element is positive, its value is doubled. If the element is negative, its value is tripled. The program displays the vector that was entered and the modified vector. Execute the program, and when the program ask the user to input a vector type randi([−10 20], 1, 19). This creates a 19-element vector with random integers between −10 and 20.
Engineering
1 answer:
ELEN [110]3 years ago
4 0

Answer:

%Program prompts user to input vector

v = input('Enter the input vector: ');

%Program shows the value that user entered

fprintf('The input vector:\n ')

disp(v)

%Loop for checking all array elements

for i = 1 : length(v)

   %check if the element is a positive number

   if v(i) > 0

       %double the element

       v(i) = v(i) * 2;

   %else the element is negative number.

   else

       %triple the element

       v(i) = v(i) * 3;

   end

end

%display the modified vector

fprintf('The modified vector:\n ')

disp(v)

You might be interested in
OSHA requires safe work practices when working around brake shoes and clutches that contain asbestos.
Nataly_w [17]

Answer:

true

Explanation:

4 0
3 years ago
Hot carbon dioxide exhaust gas at 1 atm is being cooled by flat plates. The gas at 220 °C flows in parallel over the upper and l
sergeinik [125]

The local convection heat transfer coefficient at 1 m from the leading edge is  0.44 \frac{W}{m^{2} \times K} ,  the average convection heat transfer coefficient over the entire plate is  0.293 \frac{W}{m^{2} \times K}and the total heat flux transfer to the plate is 61.6 KJ.

Explanation:

It is case of heat and mass transfer in which due to temperature difference between gas  and surface. Further temperature  boundary layer will developed on flat plate in longitudinal direction.  

Hot carbon dioxide exhaust gas

physical properties

r= 1.05 \frac{kg}{m^{3}}

c_p = 1.02 \frac{kJ}{Kg \times K}

m= 231 \times 10^{7}  \frac{N \times s }{m^2}

υ = 21.8 \times 10^{6}  \frac{m^2}{s}

k = 32.5 \times 10^{3} \frac{W}{m \times K}

\alpha = 30.1 \times 10^{6} \frac{m^{2}}{s}

Pr = 0.725

Apart from these other data arr given below,

v= 3 \frac{m}{s}  \\ p= 1 atm \\ L_c = 1.5m \\T_g= 220 C \\ T_s = 80 C

To find the local convection heat transfer coefficient at 1 m from the leading edge, we use correlation used for laminar flow over flat plate,

Nu = \frac{ h \times L }{k}  = 0.332 \times (Re^{\frac{1}{2} }) \times (Pr^{\frac{1}{3} })

where h= Average heat transfer coefficient

           L= Length of a plate

           k= Thermal Conductivity of carbon dioxide

           Re = Reynold's Number

           Pr  = Prandtle Number

(a) Convection heat transfer coefficient at 1 m from the leading edge

    is referred as local convection heat transfer coefficient.

   

   To find convection heat transfer coefficient at 1 m from leading edge,

  Nu = \frac{ h_local \times L }{k}  = 0.332 \times (Re^{\frac{1}{2} }) \times (Pr^{\frac{1}{3} })

  Here, first we have to find Re and Pr,

   Re = \frac{r \times v \times L}{m}

   Re = \frac{1.0594 \times 3 \times 1}{231 \times 10^{7}}

   Re = 20.63 \times  10^{-10}

   Pr number is take from physical property data and Pr is 0.725.

   Putting value of Re and Pr in main equation,

   we get

   Nu = \frac{ h_local \times 1 }{32.5 \times 10^{3}}  = 0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    h_local   = 32.5 \times 10^{3} \times  0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    h_local   =  0.44 \frac{W}{m^{2} \times K}

(b)  To find average convection heat transfer coefficient,

      it can be find out as case (a), only difference is that instead of L=1 m,        L=1.5 m would come,  

   Therefore,

    Nu = \frac{ h \times 1.5 }{32.5 \times 10^{3}}  = 0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    Finally,

      h  = \frac{0.44}{1.5}

      h  = 0.293 \frac{W}{m^{2} \times K}

(C) Total heat flux transfer to the plate is found out by,

     Q = h \times (T_g - T_s)

     Q = 0.293 \times (220-80) \\ Q= 0.293 \times 140  \\ Q= 61.6 KJ

     

     

   

   

     

   

     

   

   

 

   

   

   

   

8 0
2 years ago
The Cv factor for a valve is 48. Compute the head loss when 30 GPM of water passes through the valve.
dlinn [17]

Answer:

The head loss in Psi is 0.390625 psi.

Explanation:

Fluid looses energy in the form of head loss. Fluid looses energy in the form of head loss when passes through the valve as well.

Given:

Factor cv is 48.

Flow rate of water is 30 GPM.

GPM means gallon per minute.

Calculation:

Step1

Expression for head loss for the water is given as follows:

c_{v}=\frac{Q}{\sqrt{h}}

Here, cv is valve coefficient, Q is flow rate in GPM and h is head loss is psi.

Step2

Substitute 48 for cv and 30 for Q in above equation as follows:

48=\frac{30}{\sqrt{h}}

{\sqrt{h}}=0.625

h = 0.390625 psi.

Thus, the head loss in Psi is 0.390625 psi.

 

5 0
3 years ago
A 36 ft simply supported beam is loaded with concentrated loads 16 ft inwards from each support. On the left side, the dead load
lana66690 [7]

Answer:

1st part: Section W18X76  is adequate

2nd part: Section W21X62 is adequate

Explanation:

See the attached file for the calculation

8 0
2 years ago
If the head loss in a 30 m of length of a 75-mm-diameter pipe is 7.6 m for a given flow rate of water, what is the total drag fo
Stolb23 [73]

Answer:

526.5 KN

Explanation:

The total head loss in a pipe is a sum of pressure head, kinetic energy head and potential energy head.

But the pipe is assumed to be horizontal and the velocity through the pipe is constant, Hence the head loss is just pressure head.

h = (P₁/ρg) - (P₂/ρg) = (P₁ - P₂)/ρg

where ρ = density of the fluid and g = acceleration due to gravity

h = ΔP/ρg

ΔP = ρgh = 1000 × 9.8 × 7.6 = 74480 Pa

Drag force over the length of the pipe = Dynamic pressure drop over the length of the pipe × Area of the pipe that the fluid is in contact with

Dynamic pressure drop over the length of the pipe = ΔP = 74480 Pa

Area of the pipe that the fluid is in contact with = 2πrL = 2π × (0.075/2) × 30 = 7.069 m²

Drag Force = 74480 × 7.069 = 526468.1 N = 526.5 KN

3 0
3 years ago
Other questions:
  • Write a modular program that finds the equation, area, and circumference of a circle, given the coordinates of the center of the
    11·1 answer
  • Air modeled as an ideal gas enters a well-insulated diffuser operating at steady state at 270 K with a velocity of 180 m/s and e
    11·1 answer
  • Draw an ERD for each of the following situations. (If you believe that you need to make additional assumptions, clearly state th
    15·1 answer
  • Inspection with considering a variable uses gages to determine if the product is good or bad. True or False?
    15·2 answers
  • A refrigerator has a cooling load of 50 kW. It has a COP of 2. It is run by a heat engine which consumes 50 kW of heat to supply
    12·1 answer
  • A thick steel slab ( 7800 kg/m3, 480 J/kg·K, 50 W/m·K) is initially at 300°C and is cooled by water jets impinging on one of its
    14·2 answers
  • A composite wall is made of two layers of 0.3 m and 0.15 m thickness with surfaces held at 600°C and 20°C respectively. If the c
    9·1 answer
  • Why why why why why why why
    7·2 answers
  • Select the correct answer. Jude is a mechanical engineer. He works in the automobile industry. He is creating a prototype of an
    13·1 answer
  • Who has the authority to declare a "global emergency"?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!