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]
4 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]4 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
Define extensive and intensive properties of thermodynamic system.
Flura [38]

Answer:

An intense property is a physical attribute of a system that is independent of the size of the system or the quantity of material it contains. An extensive property of a system, on the other hand, is dependent on the size of the system or the amount of material in it.

Explanation:

7 0
3 years ago
Read 2 more answers
What should you, the worker, be aware of with regard to evacuation procedures at your workplace
Alinara [238K]

Answer:

As a worker, it is important to follow the proper set of instructions or emergency plans during an emergent situation. Not carefully following the rules may result to a bigger problem such as further injury and damage to property.

Explanation:

Evacuation Procedure- This is a step-by-step procedure that people follow in order to safely vacate any building or place. This procedure is applicable to any situation, such as the workplace. This is now called the <em>Workplace Evacuation Procedure. </em>This is very important because there are so many unpredictable situations or events that are happening in the world right now, such as fire or earthquake. This procedure is being done through an evacuation plan.

The awareness of the workers regarding the proper way to evacuate during emergency situation is very important. It will be easier for them to know where to locate the nearest exit route. They will also learn to stop any form of device or equipment that could cause a hazzard during the situation. In case of the hospital, which is also a workplace, the employees will also learn how to assist the patients before themselves. They will also know where to assemble if there's a need to do so.

7 0
4 years ago
Read 2 more answers
What should you consider when choosing the type of head protection
Serggg [28]

Answer: hope this helps u

Explanation:

Material,Flexibility,Comfort,Workplace Hazards

6 0
3 years ago
An Otto cycle engine is analyzed using the cold air standard method. Given the conditions at state 1, compression ratio (r), and
lilavasa [31]

Answer:

Explanation:

The detailed and careful step by step calculation and analysis is as shown with appropriate formula in the attached files

4 0
3 years ago
The steam requirements of a manufacturing facility are being met by a boiler whose rated heat input is 5.5 x 106 Btu/h. The comb
Veronika [31]

Answer:

Explanation:uhhhhhh all?

7 0
4 years ago
Other questions:
  • Which of the following is NOT true about hydraulic valves? A. Directional control valves determine the path of a fluid in a give
    10·1 answer
  • An n- channel enhancement- mode MOSFET with 50 nm thick HfO2 high- k gate dielectric (Pr = 25) has a flat band voltage of 0.5 V,
    5·1 answer
  • Emergency plans are being formulated so that rapid action can be taken in the event of an equipment failure. It is predicted tha
    12·2 answers
  • If you are setting up a race car. What is the cross weight? Does it matter?
    5·1 answer
  • 2.44mW of incident 520 nm light is directed through a1 cm sample cuvette and 0.68 mW of Plight exits the sample what is the abso
    9·1 answer
  • Which step in the engineering design process likely broke down in the following scenario?
    14·1 answer
  • At a certain location, wind is blowing steadily at 7 m/s. Determine the mechanical energy of air per unit mass and the power gen
    14·1 answer
  • The period of an 800 hertz sine wave is
    10·1 answer
  • A tool used to put a concave edge on a plane iron is
    6·1 answer
  • How does sea navigation work?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!