How to combine multi column cell in table with commas for excel?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have made a table in Matlab with various columns. Some cells of the table (for example for columns A and B) have multiple columns.
When I export this to excel it divides these up and gives me a format of columns with A_1,A_2,A_3 etc.
The data is actually a triplet of datapoints, so I want to combine the data for A into one column by using commas as a deliminator.
So for example, get an output with the first row of column A saying 33.08,24.23,5.0506
I assume I somehow need to combine the datapoints with commas before creating the table.
Is there any way to do this?
Thank you very much,
Eva
0 件のコメント
回答 (1 件)
Navya Seelam
2020 年 2 月 21 日
You can try creating table from string array rather than numeric array to combine the data for A into one column as shown below
A=[133.08 24.23 5.0506;114.65 -33.555 12.999];
Astr=num2str(A,'%5f,');
T=table(Astr(:,1:end-1));
writetable(T,'data.xlsx');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!