MATLAB: Save each loop data in one csv file save result in csv 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. Best Answer EDITED:M=10;N=15;solutions=zeros(M,N);for k=1:M solutions(k,:)=randperm(N);enddlmwrite('file1.csv',solutions) Related SolutionsMATLAB: Read and manipulate multiple .csv files You can use dir to read the name of all files with csv extensions.files = dir('*.csv');Then iterate over the files struct to read each file.for i=1:length(files) data = readmatrix(files(i).name); % or csvread(files(i).name) % process data writematrix(processed_data,txt_filename); % save to txt fileend MATLAB: How to randomly and uniquely select 2000 samples from an array with 1×460800. val(randperm(numel(val),2000)) Related QuestionRead multiple csv files and extract first 10 rows onlySave each loop values, without overwritingRead multiple .CSV files with csvread using a loopHow to append data to a CSV-file using MATLAB 7.9 (R2009b)
Best Answer