Borrar filtros
Borrar filtros

Convert cell into double

1 visualización (últimos 30 días)
Greg LANGE
Greg LANGE el 23 de Nov. de 2022
Respondida: David Hill el 23 de Nov. de 2022
{'22,1'}
ans = 1×1 cell array
{'22,1'}
{'22,1'}
ans = 1×1 cell array
{'22,1'}
{'21,8'}
ans = 1×1 cell array
{'21,8'}
{'22,0'}
ans = 1×1 cell array
{'22,0'}
I hae extrated those data from TXT file. I tried to use
% T.(i) = str2double(T{:,i});
no working
I tried to use
str2num(char({'21,8'}))
ans = 1×2
21 8
I want instead 21.8 and repeat the format for the whole colonn

Respuestas (1)

David Hill
David Hill el 23 de Nov. de 2022
Try using the following.
m=readmatrix('yourData.txt','DecimalSeparator',',');

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by