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
When plotting a single AC cycle beginning at zero degrees and moving forward in time the cycles negative peak occurs at
Lana71 [14]

Answer:A 270 degrees

Explanation:

4 0
3 years ago
What type of test can show a chemical engineer if a material remains in a system and accumulates or if it moves right through?
UkoKoshka [18]

A chemical engineer can clearly see from this kind of test if a substance stays in a system and builds up or if it just passes through.

<h3>What is a chemical engineer?</h3>
  • Processes for manufacturing chemicals are created and designed by chemical engineers.
  • To solve issues involving the manufacture or usage of chemicals, fuel, medications, food, and many other goods, chemical engineers use the concepts of chemistry, biology, physics, and math.
  • A wide range of sectors, including petrochemicals and energy in general, polymers, sophisticated materials, microelectronics, pharmaceuticals, biotechnology, foods, paper, dyes, and fertilizers, have a significant demand for chemical engineers.
  • Chemical engineering is undoubtedly difficult because it requires a lot of physics and math, as well as a significant number of exams at the degree level.

To learn more about chemical engineer, refer to:

brainly.com/question/23542721

#SPJ4

7 0
2 years ago
Decide whether the function is an exponential growth or exponential decay function, and find the constant percentage rate of gro
sasho [114]

Answer:

Just answered this to confirm my profile.

Explanation:

I dont have a clue, this is just to confirm my profile.

8 0
3 years ago
The path taken to move items from their origin to their destination is known as which of the following?
mrs_skeptik [129]

Answer:d

Explanation:

7 0
3 years ago
Oil of density 780 kg/m3 is flowing at a velocity of 20 m/s at the atmospheric pressure in a horizontal cylindrical tube elevate
Soloha48 [4]

Answer:

radius = 0.045 m

Explanation:

Given data:

density of oil = 780 kg/m^3

velocity = 20 m/s

height = 25 m

Total energy is = 57.5 kW

we have now

E = kinetic energy+ potential energy +  flow work

E = \dot m ( \frac{v^2}{2] +  zg + p\nu)

E = \dot m( \frac{v^2}{2] +  zg + p_{atm} \frac{1}{\rho})

57.5 \times 10^3 = \dot m ( \frac{20^2}{2} + 25 \times 9.81 + 101325 \frac{1}{780})

solving for flow rate

\dot m = 99.977we know that [tex]\dot m  = \rho AV

\dot m  = 780 \frac{\pi}{4} D^2\times 16

solving for d

99.97 = 780 \times \frac{\pi}{4} D^2\times 16

d = 0.090 m

so radius = 0.045 m

3 0
3 years ago
Other questions:
  • Is the ASUS ROG Strix B450-F Gaming amd ryzen 5 3600 ready?
    7·2 answers
  • Anyone have any good ways of revisiting <br> Or <br> Have any good study notes
    11·1 answer
  • Joseph wants to practice architecture. Which compulsory assessment administered by NCARB does he need to complete?
    10·1 answer
  • Problem 3: Soil Classification using the AASHTO and USCS Systems
    10·1 answer
  • If a machine uses LESS effort to overcome a given resistance force (if Fe is less than FR), it has an actual mechanical advantag
    13·1 answer
  • Place these events in chronological order. Put the numbers 1-6 next to the<br> events.
    15·1 answer
  • If the load parameters are: Vln=600kV, Il=100A (resistive), calculate the source voltage and current when the line is 50Miles (s
    14·1 answer
  • What is a splitter gearbox​
    15·1 answer
  • The most important reason to wear your seat belt is to protect you from:
    11·1 answer
  • Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!