Get rid of array strings from readtable

How do i get rid of the array strings on the "Precision" variable?

回答 (1 件)

Star Strider
Star Strider 2020 年 9 月 24 日

0 投票

Try this:
Precision = [{'91,6'}; {'91,1'}; {'90,4'}]; % Create Vector
T1 = table(Precision); % Create Table
T1.Precision = strrep(T1.Precision,',','.') % Necessary For Me (I Cannot Use ',' As Decimal Separator)
T1.Precision = str2double(T1.Precision) % Necessary
producing (nere):
T1 =
3×1 table
Precision
_________
91.6
91.1
90.4
.

2 件のコメント

Jacob Rutgersson
Jacob Rutgersson 2020 年 9 月 24 日
Ye, that works. Part of the exercise is too make it general (sadly). So i need them gone from start when i import them.
Im trying to find a Format command on the internet, like %s,%f and %u. But cant manage to find anything that fits..
Star Strider
Star Strider 2020 年 9 月 24 日
I have no idea what sort of file ‘svenp’ is (text, spreadsheet, etc.). You can use detectImportOptions (and its friends), however in most situations I find it easier to just read the data in as strings or character arrays such as this, and then do the conversions.

この質問は閉じられています。

タグ

質問済み:

2020 年 9 月 24 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by