xlswrite - not accepting stored string as valid 'A1' format for Excel
Mostrar comentarios más antiguos
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.
1 comentario
Mowgli
el 29 de Feb. de 2012
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!