I am having trouble importing data into an xlsx file from matlab. When I write
sample = [1;2;3;4] <br/> <br/>
A = {'Title'; sample};
xlswrite(filename, A);
I get the the title showing up on excel but no column numbers below it. When I erase the curly braces and the string ‘Operating Point’ (i.e. A = sample) I do get a column of numbers 1,2,3,4. However it won’t let me put a title with the numbers below it. Can anyone help me figure out what I am doing wrong. I was going by an example I saw on the mathworks help page.
When you want to write both strings and numbers to Excel, you need to write a cell array. Importantly, each element of the cell array gets written to a single Excel cell. In your case, you’d be trying to write a vector into the second cell, which won’t work.
Here’s what you want to do: