Hello, I have a text file that contains one column of words. I would like to read in the file as a string array of seperated strings so I can index the elements in the array.
hmm..I am not sure about the .odt files. The snippet of code works fine for me and throws the words out randomly. Have you tried replacing "string" with "char"?
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/491952-read-in-text-file-as-string-array#comment_769009
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/491952-read-in-text-file-as-string-array#comment_769009
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/491952-read-in-text-file-as-string-array#comment_769010
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/491952-read-in-text-file-as-string-array#comment_769010
Sign in to comment.