想請問大家要如何將資料一一存檔,自己打的程式碼如下,但是不知為何會覆寫過去,請大家幫幫忙
i=5;
while i<750
xlimits = [0,80];
ylimits = [i-5,i];
zlimits = [0,15];
player = pcplayer(xlimits, ylimits, zlimits);
indices = find(s1c1.Location(:, 2) >= i-5 ...
& s1c1.Location(:, 2) <= i ...
& s1c1.Location(:, 1) >= 0 ...
& s1c1.Location(:, 1) <= 80);
pc = select(s1c1, indices);
A=[pc.Location(:, 1),pc.Location(:, 2),pc.Location(:, 3),pc.Intensity(:, 1)];
xlswrite('data',A);
filename = ['data_' num2str(i) '.xlsx'];
i=i+5;
end
end