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
Water at atmospheric pressure boils on the surface of a large horizontal copper tube. The heat flux is 90% of the critical value
masya89 [10]

Answer:

The tube surface temperature immediately after installation is 120.4°C and after prolonged service is 110.8°C

Explanation:

The properties of water at 100°C and 1 atm are:

pL = 957.9 kg/m³

pV = 0.596 kg/m³

ΔHL = 2257 kJ/kg

CpL = 4.217 kJ/kg K

uL = 279x10⁻⁶Ns/m²

KL = 0.68 W/m K

σ = 58.9x10³N/m

When the water boils on the surface its heat flux is:

q=0.149h_{fg} \rho _{v} (\frac{\sigma (\rho _{L}-\rho _{v})}{\rho _{v}^{2} }  )^{1/4} =0.149*2257*0.596*(\frac{58.9x10^{-3}*(957.9-0.596) }{0.596^{2} } )^{1/4} =18703.42W/m^{2}

For copper-water, the properties are:

Cfg = 0.0128

The heat flux is:

qn = 0.9 * 18703.42 = 16833.078 W/m²

q_{n} =uK(\frac{g(\rho_{L}-\rho _{v})     }{\sigma })^{1/2} (\frac{c_{pL}*deltaT }{c_{fg}h_{fg}Pr  } \\16833.078=279x10^{-6} *2257x10^{3} (\frac{9.8*(957.9-0.596)}{0.596} )^{1/2} *(\frac{4.127x10^{3}*delta-T }{0.0128*2257x10^{3}*1.76 } )^{3} \\delta-T=20.4

The tube surface temperature immediately after installation is:

Tinst = 100 + 20.4 = 120.4°C

For rough surfaces, Cfg = 0.0068. Using the same equation:

ΔT = 10.8°C

The tube surface temperature after prolonged service is:

Tprolo = 100 + 10.8 = 110.8°C

8 0
3 years ago
A well-designed product will increase?​
Colt1911 [192]

Answer:

true

Explanation:

A well designed product will increase in sells and in stock.

8 0
2 years ago
To compute the energy used by a motor, multiply the power that it draws by the time of operation. Con- sider a motor that draws
ehidna [41]

Answer:

E=52000Hp.h

E=38724920Wh

E=1.028x10^11 ftlb

Explanation:

To solve this problem you must multiply the engine power by the time factor expressed in h / year, to find this value you must perform the conventional unit conversion procedure.

Finally, when you have the result Hp h / year you convert it to Ftlb and Wh

E=(12.5hp)(\frac{16h}{day} )(\frac{5 days}{week} )(\frac{52week}{year} )\\

E=52000Hp.h

E=52000Hp.h(\frac{744.71Wh}{Hp.h} )\\

E=38724920Wh

E=52000Hph(\frac{1977378.4  ft lb}{1Hph}

E=1.028x10^11 ftlb

3 0
3 years ago
What is clearance? What is backlash? What is interference? Explain briefly.
Anton [14]

Explanation:

Clearance:

For easy matching  and dis matching  of  hole and  shaft we use size of hole little bit more than the size of shaft and this difference in size is called clearance.

Backlash:

  It is the clearance between the two mating gear to avoids failure of gears.Actually when temperature of gears increases then at the same time the size of gear also increases ,due this there is a possibility foe jamming of gears so to avoids this backlash is provides.

Interference:

  When two gears are matting then addendum of one gear inters into the deddendum of another gear and due to this gears get jam .This phenomenon is called interference.

5 0
3 years ago
Select all that apply: Contaminated sharps should<br><br> not be<br><br> ----
PIT_PIT [208]

Answer:

Contaminated sharps should not be bent, recapped or removed.

Explanation:

Contaminated sharps are defined as "any contaminated object that can penetrate the skin including, but not limited to, needles, scalpels, broken glass, broken capillary tubes and exposed ends of dental wires".

4 0
3 years ago
Other questions:
  • Consider the following program:
    15·1 answer
  • white Sands national monument is a large area made of white sand dunes. what is likely to be true of this area?​
    8·1 answer
  • Which element of Miranda's character is best illustrated by this excerpt?
    15·1 answer
  • La probabilidad de que un nuevo producto tenga éxito es de 0.85. Si se eligen 10 personas al azar y se les pregunta si compraría
    12·1 answer
  • Quinn’s relatives relayed a story about putting on a headset and seeing a digital world that they could walk around in and explo
    8·2 answers
  • What is MIDI in soumd and audio engineering ? ​
    12·1 answer
  • Similarity of surface<br>and ground<br>waler​
    9·1 answer
  • Suppose the working pressure for a boiler is 10 psig, then what is the corresponding absolute pressure?
    13·1 answer
  • The velocity components expressed in m/s<br>​
    6·1 answer
  • At the beginning of last year, tarind corporation budgeted $1,000,000 of fixed manufacturing overhead and chose a denominator le
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!