フィルターのクリア

question about the sign

2 ビュー (過去 30 日間)
Dija
Dija 2014 年 12 月 4 日
コメント済み: Dija 2014 年 12 月 4 日
i have this matrix
H =
1 1 1 1 1 1 1 1
1 -1 1 -1 1 -1 1 -1
1 1 -1 -1 1 1 -1 -1
1 -1 -1 1 1 -1 -1 1
1 1 1 1 -1 -1 -1 -1
1 -1 1 -1 -1 1 -1 1
1 1 -1 -1 -1 -1 1 1
1 -1 -1 1 -1 1 1 -1
i did this code H(se+1,:)=2 H(s0+1,:)=5 to put 2 in some rows and 5 in the rest i get this
H =
2 2 2 2 2 2 2 2
5 5 5 5 5 5 5 5
5 5 5 5 5 5 5 5
2 2 2 2 2 2 2 2
5 5 5 5 5 5 5 5
2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2
5 5 5 5 5 5 5 5
it is correct but the problem that i want to keep the sign of H
i have to get this H =
2 2 2 2 2 2 2 2
5 -5 5 -5 5 -5 5 -5
5 5 -5 -5 5 5 -5 -5
2 -2 -2 2 2 -2 -2 2
5 5 5 5 -5 -5 -5 -5
2 -2 2 -2 -2 2 -2 2
2 2 -2 -2 -2 -2 2 2
5 -5 -5 5 -5 5 5 -5
help me, Thanks :)

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 12 月 4 日
編集済み: Azzi Abdelmalek 2014 年 12 月 4 日
Use sign function
In your case you can use
H(se+1,:)=2*H(se+1,:)
  1 件のコメント
Dija
Dija 2014 年 12 月 4 日
Thank you

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by