Prev: imrotate
Next: find nan in a cell array
From: Anil Kumar Palaparthi on 2 Jun 2010 17:40 Hi Everyone, I have data in cell arrays containing cell arrays. I would like to extract data from these cell arrays and store in a normal array. I am able to do it for a particular case using nested for loops. But I would like to generalize this problem such that I can extract any kind of cell array containing cell arrays just like cell2mat function does. Please let me know if there is any solution to this problem. Thanks, Anil Palaparthi.
From: Bruno Luong on 2 Jun 2010 17:50 Already discussed here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/253738 Bruno
From: Walter Roberson on 2 Jun 2010 17:52 Anil Kumar Palaparthi wrote: > I have data in cell arrays containing cell arrays. I would like to > extract data from these cell arrays and store in a normal array. I am > able to do it for a particular case using nested for loops. But I would > like to generalize this problem such that I can extract any kind of cell > array containing cell arrays just like cell2mat function does. Please > let me know if there is any solution to this problem. If it is to operate "just like cell2mat function does", then why not use cell2mat? What do you want to happen if there are empty cells? What if some of the cells are different shapes than the others? What if some of the cells are different data classes than the others? MyCell2Mat({'hello' [1:3] {} handle(gcf)}) should return exactly what??
From: James Tursa on 2 Jun 2010 17:55 "Anil Kumar Palaparthi" <thisismeanil(a)yahoo.co.in> wrote in message <hu6j44$88g$1(a)fred.mathworks.com>... > Hi Everyone, > > I have data in cell arrays containing cell arrays. I would like to extract data from these cell arrays and store in a normal array. I am able to do it for a particular case using nested for loops. But I would like to generalize this problem such that I can extract any kind of cell array containing cell arrays just like cell2mat function does. Please let me know if there is any solution to this problem. Please provide an example of your variable structure and desired output. James Tursa
From: Anil Kumar Palaparthi on 2 Jun 2010 18:07
Here is an example. My cell looks like this: x{5}{4}{3} i.e. 5 cells containing 4 cells containing 3 cells. I would like to preserve my indexing. So I would like to store the value in an array at a location x(5,4,3). -Anil. "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hu6k07$57d$1(a)fred.mathworks.com>... > "Anil Kumar Palaparthi" <thisismeanil(a)yahoo.co.in> wrote in message <hu6j44$88g$1(a)fred.mathworks.com>... > > Hi Everyone, > > > > I have data in cell arrays containing cell arrays. I would like to extract data from these cell arrays and store in a normal array. I am able to do it for a particular case using nested for loops. But I would like to generalize this problem such that I can extract any kind of cell array containing cell arrays just like cell2mat function does. Please let me know if there is any solution to this problem. > > Please provide an example of your variable structure and desired output. > > James Tursa |