How to store a table in a cell array which is inside another cell array?

Hi, I have here is a Mydata cell array which has 2 cells which actually represents no of years. So, suppose year 1 is in cell 1 and year 2 is in cell 2. Now i want my cell 1 to have a cell array of (1,2) i.e. suppose year 1 has two months : Dec and Jan. So within year 1, cell 1 will be for month of Dec and cell 2 will be for Jan. Next, I have is for the two months, tabular data with headings and numeric data. I want to store the table for dec,year 1 in MyData{1}(1,1) and so on. here goes my code.
year = 2; month = 2; MyData = cell(1,year);
for i = 1:year
for j = 1:month
MyData(1,i) = {cell(1,j)};
end
end
MyData{1}(:,1) = HourlyDec2008 ;
But I get this error in the last line as: Assignment has more non-singleton rhs dimensions than non-singleton subscripts!!
I will really appreciate if anyone can help me with this issue.

2 Comments

I have previously imported the HourlyDec2008 cell array which has 750X10 cells. Is that an Issue? Should I have to change it to matrix form?
MyData{1}(:,1) = HourlyDec2008 ;
You missed the second dimension in the above.

Sign in to comment.

Answers (0)

Categories

Asked:

on 3 Nov 2016

Commented:

on 3 Nov 2016

Community Treasure Hunt

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

Start Hunting!