How can I use the NULL file in MATLAB 7.3 (R2006b)?

6 vues (au cours des 30 derniers jours)
MathWorks Support Team
MathWorks Support Team le 27 Juin 2009
Modifié(e) : Rena Berman le 3 Avr 2017
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 31 Mar 2017
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.
 
  1 commentaire
Rena Berman
Rena Berman le 3 Avr 2017
Modifié(e) : Rena Berman le 3 Avr 2017
(Answers dev) The article has been updated.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Produits


Version

R2006b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by