How to Avoid 1.0e+03 when read the readexcel data in matlab app designer ?

조회 수: 4 (최근 30일)
Anup Patil
Anup Patil 2023년 10월 5일
편집: dpb 2023년 10월 5일
Hi
I have created an application where i want to upload excel data, in numerical data e.g. if in excel 0.000000000002 value is there in UITable it is showing up to 0.0000 and when i print that it showing 2.000000000000000e-12 , How to avoid this , I need to display this in UITable as it is 0.000000000002 and print as it is 0.000000000002

채택된 답변

dpb
dpb 2023년 10월 5일
편집: dpb 2023년 10월 5일
Formatting numeric values in the uitable is limited -- the only way you will be able to do this will be to convert to a string with the desired format and then display the string -- which means you'll have to convert it back and forth both ways--to a string to display and then back to number to use if changed or read the cell .Data value.
And, if you use a MATLAB table to display then you can't use the .Format property, rules are different for that case...it then will display the data in the same way as the command window does -- so the table column would have to be converted to character strings with the same issues in using it.
Try the below at command line, to illustrate
hUF=uifigure();
V=2E-12;
hUIT=uitable(hUF,'Data',V,'ColumnWidth',{120});
pause(5)
hUIT.Data=compose('%0.12f',V);
hUIT.ColumnWidth={140};
The problem here then will be what if the number next time is 2.3E-12? Then you'll have to have '%0.13f' to display the significant digits and the complications grow...

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by