Question: Develop a MATLAB function divisibleBy 3 ( N ) to determine if a given integer N is divisible by 3 using the following rule: if

Develop a MATLAB function divisibleBy3(N) to determine if a given integer N is divisible by 3 using the following rule: if the sum of the digits is
divisible by 3, then the integer is divisible by 3.
Only integer values should be considered valid inputs. Create a check of N for floating point values and give a warning if one is input.
Make a test script that calls your function repeatedly and checks the results. Use a simple mod (N,3) function call to check the result, which will be 0 if
divisible by 3. Create a print statement to report the result of each N examined.
In your test script call your function with a non-integer (like 4.56; it should give a warning) and the odd numbers 951-1001.
Capture the results in the command window with a screenshot.
 Develop a MATLAB function divisibleBy3(N) to determine if a given integer

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!