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
Define the Problem
gtnhenbr [62]

Answer:

rbrnrifnfnrfbdjrbfbfjrn

4 0
3 years ago
A 500-km, 500-kV, 60-Hz, uncompensated three-phase line has a positivesequence series impedance. z = 5 0.03 1 + j 0.35 V/km and
Anni [7]

Answer:

A) 282.34 - j 12.08 Ω

B) 0.0266 + j 0.621 / unit

C)

A = 0.812 < 1.09° per unit

B =  164.6 < 85.42°Ω  

C =  2.061 * 10^-3 < 90.32° s

D =  0.812 < 1.09° per unit

Explanation:

Given data :

Z ( impedance ) = 0.03 i  + j 0.35 Ω/km

positive sequence shunt admittance ( Y ) = j4.4*10^-6 S/km

A) calculate Zc

Zc = \sqrt{\frac{z}{y} }  =  \sqrt{\frac{0.03 i  + j 0.35}{j4.4*10^-6 } }    

    = \sqrt{79837.128< 4.899^o}   =  282.6 < -2.45°

hence Zc = 282.34 - j 12.08 Ω

B) Calculate  gl

gl = \sqrt{zy} * d  

 d = 500

 z = 0.03 i  + j 0.35

 y = j4.4*10^-6 S/km

gl =  \sqrt{0.03 i  + j 0.35*  j4.4*10^-6}  * 500

   = \sqrt{1.5456*10^{-6} < 175.1^0} * 500

   = 0.622 < 87.55 °

gl = 0.0266 + j 0.621 / unit

C) exact ABCD parameters for this line

A = cos h (gl) . per unit  =  0.812 < 1.09° per unit ( as calculated )

B = Zc sin h (gl) Ω  = 164.6 < 85.42°Ω  ( as calculated )

C = 1/Zc  sin h (gl) s  =  2.061 * 10^-3 < 90.32° s ( as calculated )

D = cos h (gl) . per unit = 0.812 < 1.09° per unit ( as calculated )

where :  cos h (gl)  = \frac{e^{gl} + e^{-gl}  }{2}

             sin h (gl) = \frac{e^{gl}-e^{-gl}  }{2}

     

7 0
2 years ago
Which traditional subject is part of construction management or construction science syllabi?
N76 [4]

Answer:mathematics

Explanation:

4 0
3 years ago
2. When manipulating your pedals, you should use your
astra-53 [7]

Answer:

D. left foot for the accelerator and your right foot for the brake.

* Hopefully this helps:) mark me the brainliest:)!!

7 0
3 years ago
Read 2 more answers
wo companies, Ajax Co. and Boho Inc., were negotiating a merger. In the course of the negotiations, an Ajax representative told
boyakko [2]

Answer:

Yes

Explanation:

If the Ajax representative fails to correct the previous statement this can cause misrepresentation.

4 0
3 years ago
Other questions:
  • I have a plot plan with an angle of 35 degrees on the main lot, how will this affect the construction of the basement
    9·1 answer
  • The town of Mustang, TX is concerned that waste heat discharged from a new up- stream power plant will decimate the minnow popul
    10·1 answer
  • Aerospace engineers who work for certain government agencies are often required to have security clearance. Explain two reasons
    9·1 answer
  • Shear strain can be expressed in units of either degrees or radians. a)True b)- False
    10·1 answer
  • Ok I need a new laptop but I'm not sure which one. The Surface laptop 3 is better in many fields like the camera, speaker, audio
    14·1 answer
  • A 40 mph wind is blowing past your house and speeds up as it flows up and over the roof. If the elevation effects are negligible
    14·1 answer
  • What are the benefits of using a multi view sketch to communicate a design
    14·1 answer
  • Who is???????????????????
    13·1 answer
  • Can somebody help me with that
    13·1 answer
  • Design an algorithm for computing √n
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!