MATLAB: How can i write code on this

encode

if true
f (a, b) = { 0, if a mod b = 0
{ b (a mod b), otherwise
end

Best Answer

a=input('Enter a\n');
b=input('Enter b\n');
if ~mod(a,b)
y=0
else
y=b-mod(a,b)
end