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

can someone write me a five paragraph essay of the story 'The White Umbrella " . Will give 60 points and mark brainliest . As soon as possible . do not plagiar
There are 3 times as many pears as oranges. If a group of children receives 5 oranges each, there will be no oranges left over. If the same group of children re
what is y when y+2=3/4(x+4)
The ancient Mayans used the sinkholes in the Yucatán Peninsula as
find the inverse function 5/2x-15
How do you prove lj is congruent to kj
How do the values of chivalry affect the characters in Sir Gawain and the Green Knight? Use examples from the text to support your answer.
The scourge of god was the name given to attila of the ______.
Which states were the original cotton centers? Alabama and Mississippi, Tennessee and North Carolina, Georgia and South Carolina, Virginia and Maryland
The statement of policy or value around which both sides will build their argument is the A- affirmative B- proposition or resolution C- affirmative or constru