Tobymorgan6909 Tobymorgan6909
  • 20-02-2020
  • Computers and Technology
contestada

Write a script file that creates a row vector v containing all the powers of 2 that are (strictly) less than 103. The output vector should have the form: v = [2, 4, 8, 16 ...]. Use the while loop.

Respuesta :

hamzafarooqi188 hamzafarooqi188
  • 24-02-2020

Answer:

v =[];

%intitialze variable pow with 2

pow = 2;

%repeat the while loop until pow doesn't exceed 1000

while pow <103

   %add pow to v

   v =[v,pow];

   %Generate next number that is power of 2

   pow=pow*2;

end

%Print the row vector

v

Explanation:

Answer Link

Otras preguntas

The two main dustries in Florida are tourism and a. entertainment b. mining C. agriculture d. transportation Please select the best answer from the choices prov
2. What are the last 2 digits of 1 + 2 + 3 + + 2005 2006​
The triangle below is isosceles. Find the length of side x in simplest radical form with a rational denominator. 4 + Submit Answer Answer: 2 = attempt 1 out of
If A= { 2, 4, 6, 8, 12 } and B={ 2, 4, 8 }, then find the set notation to represent { 6, 12 }.​
Need help we will be posting questions no leaks max points
Help this is due in 10 mins
The function is defined by ()= −2+6. What is the value of (10)?
20 POINTS QUICK PLEASE HELP! D: A rock starts rolling down a slope of measure 0.75. How far (in meters) from its starting point is the Rock when it is 60 meters
find the original price if the price was 420 after a 10% discount
Each cube in this figure is a -centimeter unit cube. How many cubes are in the prism? [Type your answer as a number.] how many cubes