How do I convert a multidimensional array into a 1 x1 cell array?
显示 更早的评论
I have a 1 x 20 vector and need to convert it into a 1x1 cell array without using 'reshape.'
回答(2 个)
KSSV
2017-6-19
A = rand(1,20) ;
iwant{1} = mat2cell(A,1) ;
4 个评论
Richard Wilson
2017-6-19
Walter Roberson
2017-6-19
Correlation cannot be applied directly to cell arrays: you have to index the content of the cell arrays.
Richard Wilson
2017-6-20
Walter Roberson
2017-6-20
编辑:Walter Roberson
2017-6-20
Using { } indexing.
xcorr(FirstCell{1}, SecondCell[1})
Walter Roberson
2017-6-19
Perhaps you mean,
output = {YourArray};
or perhaps you mean
output = num2cell(YourArray);
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!