You want to store the data somewhere else inside your for loop.
for N1 = [6,3] ... dataout(1) = P6; % Store P6 into first element of dataout dataout(2) = Hertz6; % Store Hertz6 in second element end
If your data is not a single value you can store to a range, dataout(:,1), or to a cell, dataout{1}.
Alternatively, you can just index P6 and Hertz6 for each loop of the for loop.
counter = 0; for N1 = [6,3] counter = counter +1; ... [P6(:,counter),W6] = ... % Store P6 results in column 'counter' Hertz6(:,counter) = ... % Store Hertz6 results in column 'counter' end