Cell contents assignment to a non-cell array object, hdf data

2 views (last 30 days)
I have data in the form of an hdf file that I would like to fit into a 2400x2400x46 matrix. Currently when I read-in the hdf data, the result is in the form of a 1x46 cell array (each cell containing a 2400x2400 matrix). I also get the error message 'Cell contents assignment to a non-cell array object.' How might I make this cell array fit into the 2400x2400x46 matrix format?

Answers (1)

Matt Fig
Matt Fig on 24 Oct 2012
Edited: Matt Fig on 24 Oct 2012
Just access each element of the cell array whenever you need to access one of the arrays,
C{1} = magic(3); % Sample cell array
C{2} = rand(2);
C{2}(2,2) % Access the element (2,2) of the 2-by-2 rand array
C{1}(3) % Access the third element in the magic matrix.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!