Why is cell2mat returning a char array and not an ordinary array?
古いコメントを表示
In the documentation it says cell2mat returns an ordinary array, but when I use it I get a n x n char array. Does anyone know how to make it do what it says it should do?
Thanks
採用された回答
その他の回答 (1 件)
Image Analyst
2015 年 7 月 31 日
Because character arrays are what's inside your cells. See the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
To use cell2mat with arrays, they have to be the same size, as Azzi said. If they're different sizes, you can use char() and it will create a rectangular array and pad it with spaces.
s={'two' 'abcd'; 'three','lotsOfChars'}
sArray = char(s)
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!