Matlab Question Write a function called DivisibleTest(M) that loops through the values 1 through M and for each number m ({m = 1,2, ...,M}) it should display ‘m is divisible by 2’, ‘m is divisible by...


Matlab Question


 Write a function called DivisibleTest(M) that loops through the values 1 through M and for each number m ({m = 1,2, ...,M}) it should display ‘m is divisible by 2’, ‘m is divisible by 3’, ‘m is divisible by 2 AND 3’ or ‘m is NOT divisible by 2 or 3’. Use a for loop, the function mod or rem to find out whether a number is divisible by 2 or 3, and num2str to convert each number to a string for displaying. You can use any combination of if, else, and elseif.



Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here