Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Write an array of data to multiple text file but it shows error

1 visualización (últimos 30 días)
AKHILA GOUDA
AKHILA GOUDA el 10 de Feb. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
x =rand(10,1);
for i=1:10
A = x*i;
textFilename = ['akg_' num2str(i) '.txt'];
fid=fopen(textFilename,'w');
fprintf(fid,'%f\n',A(i));
fclose(fid);
end
I get the error
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
error in xyz (line 6)
fprintf(fid,'%f\n',A(i));
  4 comentarios
per isakson
per isakson el 10 de Feb. de 2018
I guess you don't have write permission in the current directory
Write to a different directory
AKHILA GOUDA
AKHILA GOUDA el 10 de Feb. de 2018
yes sir exactly this is my mistake .. now it run there is no issue thanks a lot

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by