How to work on fprintf in fopen?

Hi team,
I am using following code
[ftxt,msg] = fopen([textpath keyword '_summary.txt' ],'w');
fprintf(ftxt, 'Summary sheet of %12s\n\n', TR);
and i am getting error as
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Please help me solving this problem.

Respuestas (1)

Wayne King
Wayne King el 23 de Dic. de 2013

0 votos

What is msg? That is the system-dependent error message returned by fopen. I'm assuming the value of txt is -1 meaning the fopen() operation did not work.

2 comentarios

Radhika
Radhika el 23 de Dic. de 2013
Why is it not working?
Wayne King
Wayne King el 23 de Dic. de 2013
I'm afraid you need to provide us with more information than you have given. Are we supposed to know what textpath is or keyword?

Iniciar sesión para comentar.

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Dic. de 2013

Comentada:

el 23 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by