cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

num2str output truncation

CarlA
1-Newbie

num2str output truncation

I have many bin data files that are generated (with other hardware/software where I can not control the naming but know the name) with different numbers identifying them. When I try to use num2str to generate the name for reading in the file it removes the trailing zeros and even the decimal point. For example, for the number 52.00 it outputs "52" , where I need "52.00" for use in the file name. Is there some over-ride for it to give exactly what the input is? I am sure that I can write a program to catch all the special cases and use the concat function to make the corrections, but I would rather not. Is there a simple solution?
1 REPLY 1
PhilipOakley
5-Regular Member
(To:CarlA)

Add 1000.0001 or similar then trim the string to remove leading and trailing "1" characters.

We now make sure we have a frame counter that starts at 1000 for image sequences just because of that!

Philip Oakley
Top Tags