Writeing a stings using Matlab 2015
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hassan Qassim
am 16 Feb. 2019
Kommentiert: Star Strider
am 17 Feb. 2019
Hello All
i am working on algorithm that has the ability to creat a text file and write on it depending on specific commands.
i am in need to write words using matlab and the results should be showed simultaneously in the text file (no need to re-open the text file again).
i am looking for something like attached photo.
Any suggestions?
regards
![Untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/204431/Untitled.jpeg)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Feb. 2019
The standard output (The Command Window) has a file identification number = 1.
So:
fprintf(fid, 'Hello\nWorld\n')
will print to the file , and
fprintf(1, 'Hello\nWorld\n')
or in more recent releases:
fprintf('Hello\nWorld\n')
will print to the Command Window.
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!