How to read text file in matlab?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mallikarjun Yelameli
el 11 de Mayo de 2017
Respondida: Walter Roberson
el 11 de Mayo de 2017
I have a text file. The example file attached here. Could you tell me please how to read it in table format? The 'dlmread' format is not working, since it can accept only numerics. Is there any other way to read it in table format? Thank you.
0 comentarios
Respuesta aceptada
Walter Roberson
el 11 de Mayo de 2017
S = fileread('example.txt');
info = regexp(S, '(?<label>\w+),(?<value>[^;]+)', 'names');
YourTable = array2table(str2double({info.value}), 'VariableNames', {info.label});
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Text Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!