フィルターのクリア

display correct format of table in matlab report

5 ビュー (過去 30 日間)
Jorge Zavala
Jorge Zavala 2019 年 2 月 28 日
回答済み: Jorge Zavala 2019 年 4 月 8 日
Hello,
I am adding the table below to my pdf report section using this code:
statTable = BaseTable(T);
add(sec2, statTable);
My table:
Angle Passed Failed Mean Std
______ ______ ______ ____ ____
20.00 55.92 44.08 3.39 8.58
50.00 57.04 42.96 5.17 7.41
100.00 80.68 19.32 2.54 3.05
140.00 82.78 17.22 0.94 4.35
200.00 48.04 51.96 3.34 9.15
230.00 46.87 53.13 7.60 8.07
265.00 86.86 13.14 2.08 4.96
300.00 79.34 20.66 1.81 4.00
340.00 71.84 28.16 0.48 4.96
However, I got something like this in my report:
I have tried ceil, floor, round , etc. but it does not work. Any idea of how to display only two decimals in my table report (e.g., 55.92 instead of 55.923548199952826)?

採用された回答

Jorge Zavala
Jorge Zavala 2019 年 4 月 8 日
This solution works pretty well:
data=12.4395800321;
str=sprintf('%2.10f',data)
but it is working!!

その他の回答 (1 件)

Harshita Gupta
Harshita Gupta 2019 年 3 月 20 日
Try opting for this approach . Should help you !
  1 件のコメント
Jorge Zavala
Jorge Zavala 2019 年 3 月 22 日
Hello Harshita:
Thank you for taking interest in the question.
I just changed the code to this:
format bank;
stdvec1 = round(stdvec,2);
meanvec1= round(meanvec,2);
T = table(meanvec1, stdvec1)
% Add table to report
statTable = BaseTable(T);
add(sec2, statTable);
add(nch, sec2);
and I still got:
I have tried ceil, floor, etc... but it does not change the output.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by