How to read a .txt file into Matlab?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marlene Berke
el 3 de Mzo. de 2016
Respondida: Jan
el 3 de Mzo. de 2016
I'm trying to get Matlab to read a .txt file into a string. I'm using the function readfile and can't get it to work. I have a .txt file saved in the correct directory called "April.txt" and I'm trying to say readfile(April.txt) or readfile('April.txt') and neither works. The error messages are Undefined variable "April" or class "April.txt". and Undefined function 'readfile' for input arguments of type 'char'. respectively.
0 comentarios
Respuesta aceptada
Jan
el 3 de Mzo. de 2016
Not "readfile" but "fileread":
fileread('April.txt')
Or even better with an absolute path
fileread(fullfile(Folder, 'April.txt'))
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures 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!