Vector to one cell in excel
显示 更早的评论
Hello Iam new(and dumb) to matlab and I am struggling with export data to Excel. What I need is on the firts picture, that vector is in one cell (example vector [1,0,0,0,0] is in one cell of that table, ) but when I export it to excell what I got is that every number is in its cell separeted(another picture). Can you please help me with that? Thank you.


1 个评论
dpb
2020-10-31
You can only put multiple numeric values into a single Excel cell if they are text. You'll have to convert to a string or cell string to do that.
回答(1 个)
C = {[0 1 1 0 0 1], [0 1 1 1], [0 0 0 0], [1], [1 1 1 1 ]};
Cstr = cellfun(@num2str,C,'UniformOutput',false)
writecell(Cstr', 'zapis.xlsx')

类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!