I want to know the best practice to reshape cells.
Let's say I have a 1×5 cell that has 2 observations in each cell:
cbar=linspace(0,1,2);for i=1:5 for j=1:2VAR{i}(j)=i+cbar(j); endend
Let's say I want to create another cell that will be 1×2 and will have 5 observation in each cell (so I am reshaping the VAR cell above). The way I am approaching this, which is not working, is the following
for i=1:2 for j=1:5 VAR_new{j}(i)=VAR{i}(j); endend
It happens that for some reason the VAR_new is empty.
How can I do this properly? Thank you!
Best Answer