フィルターのクリア

matrix multiplication issue.. i need the result to be in binary numbers

2 ビュー (過去 30 日間)
mary
mary 2013 年 12 月 2 日
コメント済み: sixwwwwww 2013 年 12 月 2 日
i have
m=rand(1,4)>0.5;
G=[1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 1 0 0 1 0 0 1 0; 1 0 0 1 1 1 0 1 0 0 0 1];
when i multiply them c=m*G;
c will be a vector of integer no .. i want it to be a vector of zeros and ones how should i do that?

採用された回答

sixwwwwww
sixwwwwww 2013 年 12 月 2 日
Dear Mary, you can do it as follow:
m = rand(1,4) > 0.5;
G = [1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 1 0 0 1 0 0 1 0; 1 0 0 1 1 1 0 1 0 0 0 1];
c = double(logical(m * G));
It is what you need?
  2 件のコメント
mary
mary 2013 年 12 月 2 日
yeah .. thanx alot
sixwwwwww
sixwwwwww 2013 年 12 月 2 日
You are welcome

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Operations and Transformations についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by