Borrar filtros
Borrar filtros

Alternative for fopen and dlmwrite

1 visualización (últimos 30 días)
Mahi Nazir
Mahi Nazir el 18 de Mzo. de 2015
Editada: Mahi Nazir el 19 de Mzo. de 2015
I have a large number of small .out files to be written. There are several for loops going on. A snippet:
outputfile=sprintf('AF_w.r.t_Sensor%d,Target%d at (%d,%d) and RV lines at (%.1f) .out',Col,target,txc,ty,R(Row,Col));
fid=fopen(outputfile,'w'); .. ... ... ... dlmwrite(outputfile,intersection,'-append','delimiter','\t') ... ...
fopen in write mode allows me to open a file so I can rewrite new data, erasing the old one every time I run the program and dlmwrite allows me to write data...
There is a serious performance issue with this code... it takes several minutes for each fopen and dlmwrite to execute for the number of files I have (several thousand files). How can I improve the performance? Please advice..
These files are then later accessed by other programs. Is there a way where i may not use files and store somewhere else like matrices.... can they later be accessed by other programs... but i have named eah file with sprintf... how will i identify the matrix in case i am able to use that
Thanks Mahi

Respuestas (0)

Categorías

Más información sobre Low-Level File I/O 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