MATLAB: How to check divisibility

divisionvariables

Hi, I need to check whether two numbers are divisible or not. But how can I do that in Matlab? e.g. Matlab gives 1.5 for 3/2 but I need to get 3/2 = 0 and 4/2 =2.

Best Answer

a=3;
b=2;
out=~rem(a,b)*a/b