Search for question
Question

4. The combination to a safe is a four digit integer that: • is a perfect square, • is not divisible by 4, 5, or 9. a) Write a function

in Matlab that takes one input and returns 1 if it is a perfect square, and 0 else. b) Write another function in Matlab that takes one input and returns 1 if it is not divisible by 2, 3 or 5, and returns 0 else. c) Write a program in Matlab that uses your functions and a WHILE loop to print out all possible four digit numbers that could be the safe combination.

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5