exporting binary matrix to excel

Hi using dec2bin i have converted matrix into a binary vector, now i want to export the binary vector to excel, i am facing problem that all the bits of a particular element dont appear in the single cell,.e.g ,the
second element of the vector is 100, i want it to be stored as E1 in the picture, rather than it is stored by xlswrite command like the row 2. in three different cells, A2, B2 and C2

 採用された回答

Walter Roberson
Walter Roberson 2016 年 12 月 7 日

1 投票

Provided that YourMatrix is the output of dec2bin(), which is actually character rather than numeric, then:
xlswrite(TheFileNameGoesHere, cellstr(YourMatrix))

1 件のコメント

Hafeez
Hafeez 2016 年 12 月 9 日
thank you Mr Walters for your kind support.

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

その他の回答 (1 件)

Cyrus
Cyrus 2016 年 12 月 7 日
編集済み: Cyrus 2016 年 12 月 7 日

0 投票

you can download and use this file: xlsappend.m
move the file in the same directory close to your matlab files and use it this way:
Matrix = rand([3, 10]);
[success,message] = xlsappend('a.xlsx', Matrix);
and you have to create the excel file before you run the code and file shouldn't be open.

カテゴリ

ヘルプ センター および File ExchangeNumeric Types についてさらに検索

タグ

質問済み:

2016 年 12 月 7 日

コメント済み:

2016 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by