How to write a structure to excel in MATLAB -
i have structure want write excel file.
for example, want write structure excel. contains both textdata , numbers want write excel.
>> a.textdata ans = sheet1: {'coco-cola' 'cce'} >> a.data ans = sheet1: [4 46.7100 46.2800 185.1200 -0.0092 -1.7200]
the output should this:
need guidance on how it.
what have tried far:
1) xlswrite(filename,a);
it gave me error: error using xlswrite (line 166) input data must numeric, cell, or logical array.
2) acell = struct2cell(a);xlswrite(filename,acell);
it gave me error:an error occurred on data export in csv format. caused by: undefined function 'real' input arguments of type 'struct'.
please try following:
writetable(struct2table(a), 'parameters.xlsx');
here, structure
Comments
Post a Comment