Question: use matlab or octave to code 3. (Random Digit) In a previous problem, you had to compute all digits of a given four digit number.

 use matlab or octave to code 3. (Random Digit) In a

use matlab or octave to code

3. (Random Digit) In a previous problem, you had to compute all digits of a given four digit number. Here, you will have to compute a randomly selected digit from a given four digit number. In this question, I use the terminology similar to "digit 3 of the number 7246 is 2" and "digit 1 of the number 7246 is 6". That is, digit numbers count from the right, starting at 1. rand_digit.m Script: Input variables: number is a single four digit number Output Variables: which_digit holds a random integer between 1 and 4 using randi digit holds the which_digit digit of number . A sample case is: >> number = 7246; >> rand_digit which_digit 3 digit = 2

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!