xlswrite cell array of strings to vertical array in Excel - goes wrong
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
A Jenkins
le 4 Sep 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')."
2 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!