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
True or False; If I was trying to find the Voltage of my computer, and I was given the Watts and Amps it uses, I would use Watt'
defon

Answer:

true

Explanation:

8 0
2 years ago
A strain gage is mounted at an angle of 30° with respect to the longitudinal axis of the cylindrical pressure. The pressure vess
GuDViN [60]

Answer:

1790 μrad.

Explanation:

Young's modulus, E is given as 10000 ksi,

μ is given as 0.33,

Inside diameter, d = 54 in,

Thickness, t = 1 in,

Pressure, p = 794 psi = 0.794 ksi

To determine shear strain, longitudinal strain and circumferential strain will be evaluated,

Longitudinal strain, eL = (pd/4tE)(1 - 2μ)

eL = (0.794 x 54)(1 - 0.66)/(4 x 1 x 10000)

eL = 3.64 x 10-⁴ radians

Circumferential strain , eH = (pd/4tE)(2-μ)

eH = (0.794 x 54)(2 - 0.33)/(4 x 1 x 10000)

eH = 1.79 x 10-³ radians

The maximum shear strain is 1790 μrad.

4 0
3 years ago
When the Moon is in the position shown, how would the Moon look to an observer on the North Pole?
kirill115 [55]

Answer:

cant see the moon sorry dude

5 0
3 years ago
Why is tubing sometimes coiled when installed in a car or vechile
andriy [413]

Answer:

Coiled tubing is often used to carry out operations similar to wire lining.

8 0
2 years ago
Takt time is the rate at which a factory must produce to satisfy the customer's demand. a)- True b)- False
laila [671]

Answer: a)True

Explanation: Takt time is defined as the average time difference between  the production of the two consecutive unit of goods by the manufacturer and this rate is matched with the demand of the customer. This is the time which is calculated to find the acceptable time for which the goods unit must be produced  by the factory to meet the needs of the customer. Therefore , the statement is true that takt time is the rate at which a factory must produce to satisfy the customer's demand.

6 0
3 years ago
Other questions:
  • Cng containers need to be inspected
    7·1 answer
  • Identify each statement as referring to a series or parallel circuit.
    15·1 answer
  • Consider a steam turbine, with inflow at 500oC and 7.9 MPa. The machine has a total-to-static efficiency ofηts=0.91, and the pre
    14·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • Do you understand entropy? Why the concept of entropy is difficult to engineering students?
    11·1 answer
  • What is the heart of a set of construction drawing?
    10·1 answer
  • Identify the following formulas:
    15·1 answer
  • Tech A says that LED brake lights illuminate faster than incandescent bulbs. Tech B says that LED brake lights have
    13·1 answer
  • 3. Determine the most unfavorable arrangement of the crane loads and
    6·1 answer
  • Analyze the example of this band saw wheel and axle. The diameter of the wheel is 14 inches. The diameter of the axle that drive
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!