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

Enter a number and calculate the sum of all digits
Updated 4 Jul 2011

View License

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 (2024). Find sum of digits in a number (like 4209=15) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Image Acquisition Toolbox Supported Hardware in Help Center and MATLAB Answers

Inspired: sum_digits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes