xlswrite cell array of strings to vertical array in Excel - goes wrong
Mostrar comentarios más antiguos
Hi,
I have a series of timestamps that I want to write to Excel in the following way:
xlswrite(['mpSim_results_' fname(1:end-4) '.xlsx'], outputTimes(1:10), 'Sheet1','A2:A11');
And instead of writing 10 different values to A2:A11, the value outputTimes(1) gets written 10 times to the column A2:A11. When I change this to 'A2:J2' this works fine!
When I transpose the input, it still does not work, i.e. using outputTimes(1:10)' or outputTimes(1:10).' to write to A2:A11.
Why isn't this working? Using Matlab R2012b.
Kind regards, Lennart
Respuestas (1)
A Jenkins
el 4 de Sept. de 2013
Try just 'A2' for range, not 'A2:A11'.
xlswrite(['mpSim_results_' fname(1:end-4) '.xlsx'], outputTimes(1:10), 'Sheet1','A2');
from the documentation for xlswrite:
"If you specify sheet, then xlRange can specify only the first cell (such as 'D2')."
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!