How do I convert a cell into numeric array?
조회 수: 8 (최근 30일)
이전 댓글 표시
Good Day everyone.
I have a cell array (1 x 300) which each cell contain 30 x 3 double array as illustrated below.
![1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196552/1.png)
each of double array contain 30 x 3 data that i wanted to convert to numeric array instead of being saved in a cell array.
![2.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/196554/2.png)
Previously, I did convert them manually. Is there anyone having idea how to convert with a code? I have bunch of them that takes longer time by doing it manually.
I have tried a code as below, but useless. can any experts help me on this? Much thanks!
for i = 1:300
for j = 1 : 300
Walk{j} = str2double(W(i));
end
end
댓글 수: 0
채택된 답변
madhan ravi
2018년 11월 25일
편집: madhan ravi
2018년 11월 25일
[W{:}] %at the end where W is your 1 by 300 cell array
%or
cell2mat(W)
%or
horzcat(W{:})
%or
vertcat(W{:})
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!