Is it possible to change the size of a cell in a cell array?
4 次查看(过去 30 天)
显示 更早的评论
If yes; then how do i do it?I created a cell array of dimensions (128,1) and the size of each cell is(4,1) as of now which i will have to change for getting an appropriate result. It would really feel to use some help.Thank you.
1 个评论
Image Analyst
2015-8-31
You can stuff whatever you want into a cell and it blows away what used to be in there. What's the data type? Are all cells going to be the same size? If so, and they're numbers, why not just use a regular 2D matrix? Or if they're different sizes, a structure array? Are there going to be strings in the cells?
回答(1 个)
Walter Roberson
2015-8-31
... Yes?
X = repmat({1, 2, 3, 4}, 128, 1);
X is now a cell array of length 128 that contains cells that are 1 x 4 numeric.
You can now say
X{42} = {1, 2, 3, 3.1, 3.14, 3.141, 3.1415};
and now X{42} will be a cell that contains 1 x 7 numeric.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!