save each loop data in one csv file

4 views (last 30 days)
msr16
msr16 on 5 Feb 2019
Commented: msr16 on 5 Feb 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.

Accepted Answer

madhan ravi
madhan ravi on 5 Feb 2019
Edited: madhan ravi on 5 Feb 2019
EDITED:
M=10;
N=15;
solutions=zeros(M,N);
for k=1:M
solutions(k,:)=randperm(N);
end
dlmwrite('file1.csv',solutions)
  3 Comments
msr16
msr16 on 5 Feb 2019
thanks madhan ravi it works

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!