print matrix in txt file row by row

3 visualizaciones (últimos 30 días)
Mahmoud Hassan
Mahmoud Hassan el 2 de Mzo. de 2019
Respondida: madhan ravi el 2 de Mzo. de 2019
i want to print matrix of numbers in a txt file row by row .... which means each line is a row
i am using this code to write the matrix with name LTerm in a txt file
FileName=sprintf('%d.txt',503);
file=fopen(FileName,'wt');
fprintf(file,'%6.2f, \n',LTerm);
fclose(file);
i want to print each row in a separate line

Respuestas (1)

madhan ravi
madhan ravi el 2 de Mzo. de 2019
doc dlmwrite % see precision option

Categorías

Más información sobre Cell Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by