# Answer to Question #4585 in MatLAB | Mathematica | MathCAD | Maple for jenny

Question #4585

Use Matlab to:

Create a function that accepts two numbers as input and returns 1 if the second divides the first, and 0 otherwise.

◦Bonus points if you make the function work with matrix inputs (and give a matrix output).

Create a function that accepts two numbers as input and returns 1 if the second divides the first, and 0 otherwise.

◦Bonus points if you make the function work with matrix inputs (and give a matrix output).

Expert's answer

function a= divide(x,y)

a = 1-min(mod(y,x),1);

end

a = 1-min(mod(y,x),1);

end

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment