save each loop data in one csv file

3 vues (au cours des 30 derniers jours)
msr16
msr16 le 5 Fév 2019
Commenté : msr16 le 5 Fév 2019
hi i need to save each iteration result in one csv file or matrix format.
for i=1:10
solutions=randperm(15)
end
thanks in advance.

Réponse acceptée

madhan ravi
madhan ravi le 5 Fév 2019
Modifié(e) : madhan ravi le 5 Fév 2019
EDITED:
M=10;
N=15;
solutions=zeros(M,N);
for k=1:M
solutions(k,:)=randperm(N);
end
dlmwrite('file1.csv',solutions)
  3 commentaires
madhan ravi
madhan ravi le 5 Fév 2019
See the edited answer.
msr16
msr16 le 5 Fév 2019
thanks madhan ravi it works

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Standard File Formats dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by