This will save out all the results in one excel:
output_mat = cell(numel(parameter_list),5);
for j=1:numel(parameter_list)
%my code here
%% writing output
row_header=Batch_name;
data=[X,Y,Z];
data_cells = num2cell(data);
output_matrix(j,:) = [row_header Parameter_name data_cells];
end
col_header={' ','Parameter_name','X','Y','Z'};
output_mat = [col_header;output_mat];
xlswrite([basefolder '\' 'resultls.xlsx'],output_matrix);