【发布时间】:2019-05-31 03:58:40
【问题描述】:
执行了以下代码,但我不知道在MATLAB上删除数组的元素。
因此,Array1 和 Array2 用之前的数据写出。
MATLAB 版本 R2017b
global Array1
global Array2
filename = 'data.xlsx';
for i = 1:3
sheet = i
for j = (1:2)-1
one = [1];
two = [2];
Array1 = [Array1; one]
Array2 = [Array2; two]
end
xlswrite(filename, Array1, sheet, 'A1');
xlswrite(filename, Array2, sheet, 'B1');
%here I would like to delete the elements of Array1 and Array2global
%Array1 = [];
%Array2 = [];
end
【问题讨论】:
标签: arrays excel matlab io output