xlswrite - not accepting stored string as valid 'A1' format for Excel
古いコメントを表示
I am currently trying to create a script that will output to Excel a series of 1000x8 matrices. So far my script looks like this, but it is not accepting xlcolo as a valid input and I can't figure out why. If there is an easier way to do this please help out!
xlcol = {'A3'; 'J3'; 'S3'};
xlcoli = {'A'; 'B'; 'C'; 'D'; 'E'; 'F'; 'G'; 'H'; 'I'; 'J'; 'K'; 'L'; 'M'; 'N'; 'O'; 'P'; 'Q'; 'R'; 'S'; 'T'; 'U'; 'V'; 'W'; 'X'; 'Y'; 'Z'};
%Output to Excel every 1000 trials
if rem(n,1000) == 0
a = n/1000;
if n > 3000
while a > 3
a = a - 3;
end
xlcolo = sprintf('%c%s',xlcoli(floor(n/3000)),xlcol(a));
else
xlcolo = xlcol(a);
end
xlswrite(spreadsheet, data, 'Martingale', xlcolo);
data = zeros(1,8);
end
I am aware that the code is not lasting beyond 78000 trials at the moment and will have to rectify that in the future. But for the time being I cannot work out why it thinks xlcolo is not a valid 'A1' format. I even tried displaying xlcolo in the command window before running xlswrite and it returned 'A3'.
Any help is greatly appreciated.
Regards,
Sam.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!