Making a base converter in MATLAB

I am trying to make a program that converts base 10 numbers to any base, and I am able to get it to a 20 number array. An example is converting 5371 in base 10 to base 3. The answer is 1103323, and I can get an answer of [3 2 3 3 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0] I would like to know how to eliminate all of the zeros following the last non-zero entry, in this case leaving [3 2 3 3 0 1 1] and then to display the entries in reverse order: [1 1 0 3 3 2 3]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories