How to set the variable formats in a Report Generator table?

Hi, I'm using the Report Generator and I need to output some tables, which contain the computation results.
However, the table in the report displaces very long digits, like '1.234345', which make the table a mess. I tried the solution in other threads:
table1 = varfun(@(var) round(var, 3), table1);
But it left all the zeros: '1.234000'.
Is there anyway to get rid of the zeros, or just simply change the formats of the table variables(columns)?

 채택된 답변

Sean de Wolski
Sean de Wolski 2019년 12월 16일

0 개 추천

In R2019b, the https://www.mathworks.com/help/releases/R2019b/rptgen/ug/mlreportgen.report.matlabvariable-class.html has a NumericFormat property. Before this, you need to convert the numbers to strings yourself using compose() or sprintf()

추가 답변 (0개)

카테고리

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

제품

릴리스

R2019a

질문:

2019년 12월 16일

답변:

2019년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by