This is a question related to a previous post about exporting strings to Excel and preventing them from being converted to numbers or dates; I was encouraged to start a new thread. I have a cell array of strings, each of which is a gene name, and I have appended a leading single quote to each string to force Excel to read it as a string:
myCell = {'''Abcd';'''493E07';'''Sep7'};xlswrite('myCell.xls',myCell)
When I do this, MATLAB correctly exports each string with a single quote, and Excel correctly interprets it when I open the .xls. However, when I am working with tables and attempt the same procedure, MATLAB exports each string with not one, but two leading single quotes for each string, even though using disp() to examine the table contents shows only one leading single quote:
myTable = table(myCell);disp(myTable.myCell{1});writetable(myTable,'myTable.xls')
I've attached the output. This problem occurs whether I'm using .xls or .xlsx. I have MATLAB R2017b.
Best Answer