Cell array to xlsx file
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an array of cell sized 1 X 476.
Each element in the cell contains 116 X 1 sized data.
I want to convert this to a 116 X 476 data and write it into an xlsx file.
Could anyone help me with this ? Thanks.
댓글 수: 0
답변 (1개)
Ran Yang
2023년 4월 11일
You can concatenate each element of your cell array using cat or convert the cell array to a regular array using cell2mat. Then save as a spreadsheet.
x = {[1;2;3], [10;11;12]} % sample data (cell size 1x2, each cell contains data 3x1)
y = cat(2, x{:})
y = cell2mat(x)
writematrix(y, 'table.xlsx');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!