Cell Conversion Problem when transformed into a matrix form
    4 次查看(过去 30 天)
  
       显示 更早的评论
    
Dear Community,
I have a 324x324 cell array, each variable contains a 3x3 Matrix inside and I want to transform this same cell into a matrix so I can operate with it.
I tried cell2mat but unfortunately I got this error:
Error using cat
Dimensions of arrays being concatenated are not
consistent.
Error in cell2mat (line 83)
            m{n} = cat(1,c{:,n});
Do you know how to solve this problem?
0 个评论
回答(1 个)
  Walter Roberson
      
      
 2020-9-25
        mask = cellfun(@(M) ~isequal(size(M), [3,3]), YourMatrix);
find(mask)
You will discover that some elements are not 3x3. For example some might be empty.
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!