Using MatLab Question 3: Write a program that continuously asks the user to ente
ID: 668084 • Letter: U
Question
Using MatLab
Question 3: Write a program that continuously asks the user to enter numbers until the user enters a number bigger than 100. The numbers before the last one (non-negative numbers) are saved in a vector B. Then display B and the average value in B. For instance, if the user enters 3, 5, 0, 7, 11, 130, the input stops and B is [3, 5, 0, 7, 11]. The average value of B is 5.2. Use loop. Do not use sum () or mean () built-in functions. Hint: How do you save a number x to B? B=[B x]Explanation / Answer
count = 0; while (number > 1) number = number / 2; % must "move" toward end of loop count = count + 1; end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.