Question: Code language is MATLAB. Question 3: Sum the digits of a given number. Ask user to input a number and find the summation of the

 Code language is MATLAB. Question 3: Sum the digits of a

Code language is MATLAB.

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!