Precision of variables inserted into a report

I am inserting a large number of floating point variable into a Matlab Report Generator report using the %<VariableName> format. (Reference page is here: http://www.mathworks.com/help/rptgen/ug/text.html#f19023)
I want to be able to specify the precision of the variables. For example, if I'm entering in a percentage of 75.4632%, I'd like to limit that to one decimal point: 75.5%.
I know I could covert all of the floating point values to strings but that would be very tedious for the 100's of variables I have. Is there any other way to do this?

1 Comment

Seems like a big hole afaict unless the custom components stuff would let you do it -- but I'd not hold out much hope.
Looks to me like you'd have to use
c=num2str(variable,fmt);
and then export the character variable instead of the float from what I can see. Then again, I've never used the report generator so all I know is what I gleaned from the link you posted and the poking around there some from that point. No magic seemed to appear...

Sign in to comment.

Answers (0)

Categories

Asked:

on 23 Oct 2013

Commented:

dpb
on 23 Oct 2013

Community Treasure Hunt

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

Start Hunting!