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!