-
2 Comments
Pasumarthi Viswanath
on 11 Nov 2012
please explain why the digits get separated when (num2str(2^n)-'0') is performed
Cris Luengo
on 12 Nov 2012
num2str converts the integer number into a string representation of that number: 1234 becomes '1234', which is the same as ['1','2','3','4']. Now you've got one array entry per digit. Subtract '0' from there, then the char array will become a double array with value 0 where the char was '0', etc.
Suggested Problems
-
2354 Solvers
-
Get the area codes from a list of phone numbers
1062 Solvers
-
1406 Solvers
-
Matrix indexing with two vectors of indices
733 Solvers
-
Basics: 'Find the eigenvalues of given matrix
423 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!