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 Kommentar

dpb
dpb am 23 Okt. 2013
Bearbeitet: dpb am 24 Okt. 2013
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...

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Variables finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 23 Okt. 2013

Kommentiert:

dpb
am 23 Okt. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by