How can I use the NULL file in MATLAB?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 30 de Ag. de 2024
I would like to use the NULL file from MATLAB to suppress output to the screen. In earlier releases of MATLAB I would use the file identifier of 0 for this purpose.
Respuesta aceptada
MathWorks Support Team
el 30 de Ag. de 2024
Editada: MathWorks Support Team
el 30 de Ag. de 2024
Prior to MATLAB R2013b, the syntax for opening a NULL file on Windows is:
null = fopen('NUL:')
On UNIX/Linux the NULL file is opened by using:
null = fopen('/dev/null')
To open a NULL file using MATLAB R2013b on Windows, the syntax is:
null = fopen('NUL ')
Please note that there is now a space between the "L" and the terminating apostrophe.
The returned file identifier can be used in FPRINTF or FWRITE.
Starting with R2017b it is not possible to open a NULL file with MATLAB on Windows anymore.
1 comentario
Rena Berman
el 3 de Abr. de 2017
Editada: Rena Berman
el 3 de Abr. de 2017
(Answers dev) The article has been updated.
Más respuestas (0)
Ver también
Categorías
Más información sobre Performance and Memory 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!