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

dpb
dpb 2013년 10월 23일
편집: dpb 2013년 10월 24일
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...

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

질문:

2013년 10월 23일

댓글:

dpb
2013년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by