Convert scientific notation in table

29 Ansichten (letzte 30 Tage)
Konvictus177
Konvictus177 am 25 Jan. 2022
Beantwortet: Rahul am 11 Okt. 2024
Hi,
I create a table that looks like this:
How can I get rid of the scientifc notation in the last two columns? I want to create uitable using the struct or trable above.
Thanks.
  1 Kommentar
Benjamin Thompson
Benjamin Thompson am 25 Jan. 2022
Is this a table in Excel? If you import a text file into MATLAB, formatting does not matter because you can choose the display format later on. Can you post code or sample data?
See the article on uitable in the MATLAB documentation or "Table Properties" for how to use the uitable ColumnFormat property to control the display.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rahul
Rahul am 11 Okt. 2024
I understand that you wish to adjust the notation of the data in your table. Considering you have obtained the table in your MATLAB workspace using the 'readtable' function. You can use the 'convertvars' function to adjust the data type of the desired columns according to your specifications.
Here is an example:
T1 = readtable('yourTableName.csv');
T2 = convertvars(T1,{'columnNameToChange'},'single');
% Here I have used random file and column names, you can adjust that accordingly.
% I have converted the data type of the column to 'single', however
% conversion to 'double', 'int8', 'int16', 'int32' and many more are possible
You can refer to the following MathWorks documentations to know more:
Hope this helps! Thanks.

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by