MATLAB: How to assign two variables in single cell

cell arrays

Consider a cell in a matrix (2,2). I want to assign carbon concentration value as well as grain number value to that cell. How is it possible. Which data structure should I use. Please explain.

Best Answer

datacell(2,2) = struct('carbon', [], 'grain', []);
now you can look at datacell(1,1).carbon, datacell(2,1).grain and so on.
datacell(1,2).carbon = 17;
datacell(2,2).grain = 9;
and so on.