Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
keep 0s in front of the number

Subject: keep 0s in front of the number

From: Patrick Diviacco

Date: 29 Oct, 2009 17:55:20

Message: 1 of 2

hi,

currentImage is an integer 0085

num2str(currentImage)
%the resulting string is "85"

I need to keep the 0s in front of the number.

How can I do it ?

thanks

Subject: keep 0s in front of the number

From: Ashish Uthama

Date: 29 Oct, 2009 18:01:02

Message: 2 of 2

On Thu, 29 Oct 2009 13:55:20 -0400, Patrick Diviacco
<patrick.diviacco@gmail.com> wrote:

> hi,
>
> currentImage is an integer 0085
>
> num2str(currentImage)
> %the resulting string is "85"
>
> I need to keep the 0s in front of the number.
>
> How can I do it ?
>
> thanks

help sprintf?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us