dlmwrite problem within loop

i want to write matrix that result from loop in a txt file comma delimited i write the following command:
dlmwrite(['Test_data_Proposed', num2str(flag),'.txt'] , all_measured,'delimiter',',');
as flag is the counter within loop, all_measured is the matrix the error that all txt files have the same length although they don't. dlmwrite fixes the txt file length to 795 while all_measured values could exceed 1000 or less. How Could i fix this issue?

6 commentaires

Walter Roberson
Walter Roberson le 19 Déc 2017
What is class(all_measured) and size(all_measured) ?
Rana Sobhy
Rana Sobhy le 19 Déc 2017
Modifié(e) : Walter Roberson le 19 Déc 2017
double
size(all_measured)=[x 17]
it is variable size for each loop , as x is the number of rows
Rana Sobhy
Rana Sobhy le 19 Déc 2017
i mean dlmwrite overwrite the existing matrix in the txtfile even if i make matrix =0
Walter Roberson
Walter Roberson le 19 Déc 2017
Modifié(e) : Walter Roberson le 19 Déc 2017
The only time I have ever seen file writes returning a fixed file size was when I was using up the very last of my disk space.
Could you attach a .mat for one that you are having difficulty with?
Walter Roberson
Walter Roberson le 19 Déc 2017
dlmwrite() is intended to overwrite the existing content unless you use the -append flag .
Rana Sobhy
Rana Sobhy le 19 Déc 2017
i don't use append option . Even if i use it , in each loop i write in diffrent file .
i couldn't upload the file as it calls more than 3 function related o images

Connectez-vous pour commenter.

Réponses (0)

Question posée :

le 19 Déc 2017

Commenté :

le 19 Déc 2017

Community Treasure Hunt

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

Start Hunting!

Translated by