Export multiple datasets to one Excel sheet in Matlab -
hej, have data, want export excel. data consists of several sequences, , each sequence stored dataset. normally, 'dataset' class quite neat, allowing store variable , observation names. therefore, keep it.
for single datasets use 'export' function (as opposed 'xlswrite'), e.g.:
export(data, 'xlsfile' ,[pathname '\' filename],'sheet',1);
this writes dataset 'data' specified spread sheet.
now want export multiple datasets 1 spread sheet. thus, can't use 'export' function anymore (as far know).
i know can specify range function 'xlswrite' , make nice loop, e.g.:
for isequence 1:nrsequences xlrange= ...; xlswrite([pathname '\' fname],data{isequence},sheetnumber,xlrange); end
this works fine if 'data{isquence}' array, but... not work datasets. trying datasets produces following error:
'error using xlswrite (line ...) input data must numeric, cell, or logical array.'
so, know, how this?
<<this copy of suggestion comment appears have solved op's problem>>
you may have noticed mathworks' notification in documentation dataset
:
the
dataset
data type might removed in future release. work heterogeneous data, use matlab®table
data type instead. see matlabtable
documentation more information.
therefore, should make transition table
. then, use built-in functions support table-to-excel export.
Comments
Post a Comment