i have cell array in matlab contains numeric data stored string. maintain string format when export file. however, when use xlswrite, excel automatically converts these double values. know how prevent this?
here's example of have written:
c = {'123'}; xlswrite('example.xls', c); when check file, "123" stored number. specifically, can perform arithmetic operations on it.
insert single quotation in front of each number before writing file. single quotation @ beginning informs excel wish input string regardless of contents:
c = {'''123'}; xlswrite('example.xls', c); you need use 2 ' characters symbolize single quote ensure matlab doesn't ambiguously think you're trying start string... sure we're on same page:
c = {'''123'); ||| | abb a denotes starting , ending of string , b denotes declaration of single quotation.
Comments
Post a Comment