MATLAB: Convert struct2mat

struct2mat

I have a struct.I want convert this struct to matrix. I used the
cell2mat( struct2cell( YourStructure ) )
command and I got that error
Error using class
Not enough input arguments.
My struct name is 'class'. I used this
cell2mat(struct2cell(class)).

Best Answer

This example perfectly works for me. Are you sure that your class struct is really a struct, or what kind of field does it contain? For instance:
class=struct('a',3);
cell2mat(struct2cell(class))
This one can be converted to mat without any error.