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
Select the correct answer. Ruby wants to create a cube puzzle game. For that she has to create a cube. Which drafting tool do yo
Alexxx [7]

Answer:

D. a triangle and a T-Square

Explanation:

A T-Square is the best drawing tool to create squares. You would need a squares to create cubes.

3 0
3 years ago
Bằng lý luận và thực tiễn, bạn hãy trình bày ý kiến của mình về quan điểm sau đây: "Quá trình dạy học là quá trình truyền thụ tr
mrs_skeptik [129]

Answer:

can you please ask in English I can't understand this language

7 0
3 years ago
A 1000 kg turbine has a rotating unbalance of 0.1 kg.m. The turbine operates at a speed between 500 to 750 rpm. What is the maxi
raketka [301]

Answer:

maximum isolator stiffness k =1764 kN-m

Explanation:

mean speed of rotation =\frac{N_1 +N_2}{2}

Nm = \frac{500+750}{2} = 625 rpm

w =\frac{2\pi Nm}{60}

  =65.44 rad/sec

F_T = mw^2 e

F_T = mew^2

       = 0.1*(65.44)^2

F_T =428.36 N

Transmission ratio =\frac{300}{428.36} = 0.7

also

transmission ratio = \frac{1}{[\frac{w}{w_n}]^{2} -1}

0.7 =\frac{1}{[\frac{65.44}{w_n}]^2 -1}

SOLVING FOR Wn

Wn = 42 rad/sec

Wn = \sqrt {\frac{k}{m}

k = m*W^2_n

k = 1000*42^2 = 1764 kN-m

k =1764 kN-m

3 0
3 years ago
A 3 m aluminum pole is kept at a residential site for construction
Aliun [14]

Answer:

I don't know sorry

Explanation:

5 0
3 years ago
3. In order to obtain your commercial driver's license (CDL) you must first:
Murljashka [212]
A and C is the answer to the question. Be 15 years old & get a permit
8 0
3 years ago
Other questions:
  • What Type of diploma do you need in order To the get into JMU
    12·1 answer
  • Water flows through a nozzle at the end of a fire hose. If the nozzle exit velocity must be 20 m/s and the exit diameter is 40 m
    6·1 answer
  • Suppose we want to determine how many of the bits in a twelve-bit unsigned number are equal to zero. Implement the simplest circ
    14·1 answer
  • You need to bake 2 dozen chocolate chip
    12·1 answer
  • Researchers at the University of__________modified the iPhone to allow it to create medical images.
    9·2 answers
  • Drag each label to the correct location on the table. Match to identify permanent and temporary structures.
    15·1 answer
  • What are the main microsoft ware packages widely used today​
    6·2 answers
  • If a condenser has high head pressure and a higher than normal temperature, a technician could ____.
    7·1 answer
  • When hermetic refrigerant motor-compressors are designed to operate continuously at currents greater than 156 percent of the rat
    10·1 answer
  • Imagine the arc of a football as it flies through the air. How does this motion illustrate classical mechanics?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!