save each loop data in one csv file

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.

 采纳的回答

EDITED:
M=10;
N=15;
solutions=zeros(M,N);
for k=1:M
solutions(k,:)=randperm(N);
end
dlmwrite('file1.csv',solutions)

3 个评论

i need all solutions in one csv file but this create 10 file.
See the edited answer.
thanks madhan ravi it works

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Standard File Formats 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by