Writeing a stings using Matlab 2015

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

 Respuesta aceptada

Star Strider
Star Strider el 16 de Feb. de 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 comentarios

Hassan Qassim
Hassan Qassim el 17 de Feb. de 2019
thanks for your quik reply
i am looking for something like
My worlds should be written simultaneously in an external text file, and i can see the words being written as the algoirthm implemented step by step.
regards
Star Strider
Star Strider el 17 de Feb. de 2019
My pleasure.
The approach in my code will allow you to write it to your file and write it to your Command Window. They will not be written absolutely simultaneously, but closely enough.
Hassan Qassim
Hassan Qassim el 17 de Feb. de 2019
I will use the command window for showing up the written words, thanks a lot for your help
really apreciated
Star Strider
Star Strider el 17 de Feb. de 2019
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Centro de ayuda y File Exchange.

Productos

Versión

R2015a

Etiquetas

Preguntada:

el 16 de Feb. de 2019

Comentada:

el 17 de Feb. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by