Question: Use while-end, i f -end, break commands to solve the numerical problem Write a script file named PBTask3pS.m that sums a sequence of random numbers
Use while-end, i f -end, break commands to solve the numerical problem
Write a script file named PBTask3pS.m that sums a sequence of random numbers (use rancin) until the sum is greater than 10. If the random number generated is greater than 3, exit the loop immediately without doing the sum.
Display the sum of the random numbers and the last random number generated in command window when the program terminates. The display format may like this:
>> PBTask3p5
The sum of the random numbers is: 10.571232
The last random number generated is: 1.618112
Step by Step Solution
3.32 Rating (158 Votes )
There are 3 Steps involved in it
To tackle the problem youve described well write a MATLAB script named PBTask3pSm The script will use while if and break structures alongside the rand ... View full answer
Get step-by-step solutions from verified subject matter experts
