Skip to content

Instantly share code, notes, and snippets.

@suchow
Created January 3, 2013 01:12
Show Gist options
  • Save suchow/4439973 to your computer and use it in GitHub Desktop.
Save suchow/4439973 to your computer and use it in GitHub Desktop.
fizzbuzz in MATLAB
% fizzbuzz in MATLAB
for i = 1:100
if(mod(i,3) && mod(i,5))
fprintf('%i\n', i);
else
if(~mod(i,3))
fprintf('fizz');
end
if(~mod(i,5))
fprintf('buzz');
end
fprintf('\n');
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment