フィルターのクリア

Cell array to xlsx file

1 回表示 (過去 30 日間)
sai prasanna sai prasanna m s
sai prasanna sai prasanna m s 2023 年 4 月 11 日
回答済み: Ran Yang 2023 年 4 月 11 日
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.

回答 (1 件)

Ran Yang
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)
x = 1×2 cell array
{3×1 double} {3×1 double}
y = cat(2, x{:})
y = 3×2
1 10 2 11 3 12
y = cell2mat(x)
y = 3×2
1 10 2 11 3 12
writematrix(y, 'table.xlsx');

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by