Find sum of digits in a number (like 4209=15)

Enter a number and calculate the sum of all digits

You are now following this Submission

This script sums up all digits in a number, for example the number 548012410121 will output 29 which is the sum of all digits

Cite As

Mohammad Saadeh (2026). Find sum of digits in a number (like 4209=15) (https://www.mathworks.com/matlabcentral/fileexchange/32047-find-sum-of-digits-in-a-number-like-4209-15), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: sum_digits

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0