Programación Específica > Matlab
como leer .txt de Matlab
Miota85:
La solucion esta en la ayuda de la funcion fopen, del propio matlab. Concretamente en las siguientes lineas:
To open files in text mode, attach the letter 't' to the permission, such as 'rt' or 'wt+'. For better performance, do not use text mode. The following applies on Windows systems, in text mode:
Read operations that encounter a carriage return followed by a newline character ('rn') remove the carriage return from the input.
Write operations insert a carriage return before any newline character in the output.
This additional processing is unnecessary for most cases. All MATLAB import functions, and most text editors (including Microsoft Word and WordPad), recognize both 'rn' and 'n' as newline sequences. However, when you create files for use in Microsoft Notepad, end each line with 'rn'. For an example, see fprintf.
Vamos, que la solucion simplemente es poner una t. En vez de poner fid=fopen('nombre.txt','w+') , por ejemplo, poner fid=fopen('nombre.txt','wt+')
Asi el block de notas de windows lo abre bien.
Navegación
[*] Página Anterior
Ir a la versión completa