Extract cell with number lines and columns
    4 次查看(过去 30 天)
  
       显示 更早的评论
    
Hello, I would like to automatically extract a cell of 1 row and 20 columns among so many others, 
what functions do you think I can use?
thank
Have a good day
2 个评论
回答(6 个)
  Akshay Malav
      
 2019-6-20
        Okay here is the explaination 
Let's say that you have a cell Array A which contains a cell array inside it ,it has dimension from 1 to 100 you can change it to your size of array.
Now I have just looped through the array A and for each element of array A which is A{i}  checked it's size and then stored that cell  in b array .
Hope this helps
A = cell(1,100);
A{4} = cell(1,20);
A{5} = cell(1,33);
A{6} = cell(1,20);
A{7} = cell(1,20);
b = []; 
for i = 1:100
    [row col] = size(A{i});
    if row == 1 & col == 20
        b = [b A{i}];
    end
end
0 个评论
  Akshay Malav
      
 2019-6-20
        So  let's say A is the cell array and you want to access it's 4th element then you can do A{4} . And now if you want to access let's say 6th element of A{4}  then you can do A{4}{6}
Hope it helps 
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



