フィルターのクリア

Using reshape function i get wrong ans....

4 ビュー (過去 30 日間)
ARJUN K P
ARJUN K P 2015 年 5 月 18 日
コメント済み: ARJUN K P 2015 年 5 月 18 日
b=[0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1];
>> SS=reshape(b,length(b)/8,8);
>> SS
SS =
0 0 0 0 0 0 0 0
1 0 1 0 1 0 1 0
0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1
bt i want to get
SS =
0 1 0 0 0 0 1 0
0 1 0 0 0 0 1 0
0 1 0 0 0 0 1 0
0 1 0 0 0 0 1 0
ie what my array b data.. thats i want to be in SS.. how i write code? Help me
  1 件のコメント
Jan
Jan 2015 年 5 月 18 日
Where does the trailing zero column come from? It is not clear why the last and teh 2nd last column seem to have swapped.

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 5 月 18 日
b=[0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1];
SS=reshape(b,8,[]);
SS([end,end-1],:) = SS([end-1,end],:);
SS = SS';
  6 件のコメント
ARJUN K P
ARJUN K P 2015 年 5 月 18 日
編集済み: ARJUN K P 2015 年 5 月 18 日
sry its my mistake..
b=[0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1]; i want to group each 8 bits in array b.. that is i want my ans like
0 1 0 0 0 0 0 1
0 1 0 0 0 0 0 1
0 1 0 0 0 0 0 1
0 1 0 0 0 0 0 1
ARJUN K P
ARJUN K P 2015 年 5 月 18 日
thanku all i got ans.... special thanks to Andrei Bobrov code is working

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by