我正在运行MATLAB R2017a。我正在尝试执行一个将3个字符写入Excel文件的简单程序。当我使用少量值运行程序时,这很好,但是当我将其增加到数百万时,程序将暂停。
有人知道为什么编程会这样暂停吗?
X = []
filename = 'PopltnFL.xlsx';
NumTrump = 4617886;
NumClinton = 4504975;
NumOther = 297025;
*% Values for which program runs without puasing*
% NumTrump = 4;
% NumClinton = 4;
% NumOther = 2;
%
for ii = 1:NumTrump
X = [X,'T'];
end
for jj = 1:NumClinton
X = [X,'C'];
end
for kk = 1:NumOther
X = [X,'O'];
end
X = X';
xlswrite(filename,X)