Writing cell array to an excel file - Empty!

3 ビュー (過去 30 日間)
Panda
Panda 2016 年 4 月 7 日
コメント済み: Azzi Abdelmalek 2016 年 4 月 7 日
Hello
I have a cell array of size 267X400 where every cell is a has 3 elements (A:B:C for eg.). I would like to copy the contents of this cell array to -
1. A text file 2. An excel file
For the text file, I used the following code:
[nrow ncol]=size(combi);
%formatspec=repmat('%u\t',1,size(combi,2));
for j=1:nrow
fprintf(fileID,[repmat('%u\t',1,size(combi,2)) '\n\n'],combi{j,:});
end
problem is that the text file displays upto some columns properly and then its random.
2. For the excel file, I used xlswrite ('Filename',combi) .All i get is a blank excel file.
Any insights as to where I am going wrong, it would be nice.
Thanks!
  2 件のコメント
Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 4 月 7 日
can you provide your sample cell array. I want to investigate it
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 7 日
Can you post a short example that illustrate how your data are stored, for example a 2x2 cell array

サインインしてコメントする。

回答 (1 件)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 4 月 7 日
try this
xlswrite ('Filename',combi(:))
  1 件のコメント
Panda
Panda 2016 年 4 月 7 日
@Saleem..no bro..it aint working. The excel file is still empty...

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by