Can you write an array containing both numerical data and a string to excel?
Show older comments
Hi,
I am trying to send an array which contains both numerical data and a string to an excel file.
I begin by reading in the excel file and then append new data to the bottom of my data before sending this back to the excel file. A simplified example is shown:
M=xlsread('Book1.xlsx',1);
N=[0:10];
M=[M;N]; %To add my data N to the bottom of the original M.
xlswrite('Book1.xlsx',M,1,'A2')
This works fine as long as I use only numerical data. However I would like to extend the functionality so that I could also write a variable x to the excel file, where x is a string stored in my workspace.
So my data would look like the following:
N=[0 1 2 3 4 5 6 7 8 9 10 x]
where x is a string.
Is this possible?
Many thanks,
David Graham.
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!