Alternative to int2str without using sprintf or other like functions?

5 views (last 30 days)
I'm looking to code int2str without using int2str, basically, but i only need the numbers.
Right now I have
number=input %lets say its 90 int2str(number); '90'
But I would like a different way to do this without using matlab internal function like -printf

Answers (1)

Image Analyst
Image Analyst on 12 May 2014
Why the grudge against sprintf()? Do you hold a grudge against num2str() also? If not, then do this:
strNumber = num2str(number);
  4 Comments
John
John on 13 May 2014
Yeah, it's interesting knowing how to code from scratch just for fun or knowledge I suppose. I ended making a huge complicated concatenation that tore a number apart into part of an array of each digit, then making a large switch case for each digit 0-9. Thank you!

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!