MATLAB: How to convert a dataset array into a cell array in Statistics Toolbox 6.2 (R2008a)

arraycelldatasetStatistics and Machine Learning Toolbox

I am using dataset arrays to manipulate data that I pull from a database. After manipulation, I want to convert it back into a cell array and put it back into the database.

Best Answer

Beginning with MATLAB R2012b, you can use the "dataset2cell" command.  For previous product releases, read below for any possible workarounds:
The ability to convert a dataset array directly into a cell array is not available in the Statistics Toolbox.
As a workaround, write a conversion function that accesses the data within a dataset array and puts the elements into a cell array. An example of this is attached as ds2cell.m.
Please note that this function assumes your data set has both variable and observation names. You may have to modify this function to fit your particular application.