Skip to content

Instantly share code, notes, and snippets.

@wyudong
Created January 7, 2015 12:27
Show Gist options
  • Save wyudong/7d896b4daf8bf5c5b4fc to your computer and use it in GitHub Desktop.
Save wyudong/7d896b4daf8bf5c5b4fc to your computer and use it in GitHub Desktop.
MATLAB - Get digital values of a number
num = '123456789';
str = num2str(num);
val = str - '0'; % val = [1,2,3,4,5,6,7,8,9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment