0
votes

I have been working with some MAT files (using MATLAB) which appear to be structured as groups of cells, where each cell has an 1xn dimension and for 1 to n, there is a 1x1 struct.

While this may not be the most ideal way to handle the data I'm working with, I wishing to keep very similar code the one I have already invested some time in. I have been trying to recreate a similar structure from scratch, however upon defining a cell and struct, I am unaware how to include each struct in the cell.

I have tried simply using

cellexample(1,n) = structexample

However the following error message is quoted: "Conversion to cell from struct is not possible."

Any quick pointers would be greatly appreciated.

1

1 Answers

2
votes

You should use {} like so to set the value in cell:

cellexample{1,n} = structexample;