Reading strings from text file to a MATLAB cell array
Mostrar comentarios más antiguos
I have a text file with data that looks like this:
Ta Example Name1
Tn Example Name2
Th Example Name3
Td Example Name4
Tg Example Name5
The 'Ta', 'Tn', etc. will always be the same length of 2 characters but 'Example Name1' and 'Example Name2' will not. I'd like to read this information into a cell array or other array in MATLAB so that the first column contains the identifier (Ta, Tn, Th, etc.) and the second column contains the name.
I've tried several approaches using a CSV file but it was difficult to append the file with a cell array of strings (not supported with xlswrite, dlmwrite, etc.).
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!