Question: Matlab Question 2: Divide two numbers that are entered by the user. Ask user to input 2 numbers a and b and find a/b. Repeat

Matlab
Matlab Question 2: Divide two numbers that are entered by the user.

Question 2: Divide two numbers that are entered by the user. Ask user to input 2 numbers a and b and find a/b. Repeat the division 3 times total. If the user enters b=0, display 'Denominator cannot be O' and skip to the next division. (15 points) Example: 1st number: 1 2nd number: 4 ratio = 0.2500 1st number: 5 2nd number: 0 Denominator cannot be 0 1st number: -3 2nd number: 7 ratio = -0.4286 Question 3: Sum the digits of a given number. Ask user to input a number and find the summation of the digits. Example: input: 1453 output: 13 (since 1+4+5+3=13) Hint: You can use numel(num 2str(number)) to get the number of digits in a number. Other commands that may be used in your solution: mod, floor. (15 points) Question 4: Display 5 coin flip outputs by using rand function. rand gives random values between (0,1). You need to have output either -1 (head) or 1 (tails). Hint: rand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!