How to select elements from matrix?

For the below code we will get 53440*8 matrix.
fid = fopen( 'audio.wav');
data = fread(fid, [1, Inf], 'uint8');
fclose(fid);
bit = uint8(rem(floor((1 ./ [128, 64, 32, 16, 8, 4, 2, 1].') * data), 2));
bit = bit(:);
bit = dec2bin(data) - '0'
Now I want to select 8*8 elements from the matrix.
How can I do that?Please help me out.
Thank you!

3 件のコメント

dpb
dpb 2019 年 4 月 27 日
data = fread(fid, [1, Inf], 'uint8');
bit = uint8(rem(floor((1 ./ [128, 64, 32, 16, 8, 4, 2, 1].') * data), 2));
bit = bit(:);
bit = dec2bin(data) - '0'
What's the point of lines 2 and 3 when you immediately then overwrite the result?
Any 8x8 set of elements or some particular set(s)???
N M Channabasavayya
N M Channabasavayya 2019 年 4 月 27 日
Particular sets..like starting 8*8 elements.
or can you suggest me in general how can I select elements?
dpb
dpb 2019 年 4 月 27 日
N=8; % how many (if not necessarily 8 rows)
i1=1; % set first index
i2=i1+N-1; % compute last row index
B=bit(i1:i2,:); % and select those rows, all columns

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

回答 (0 件)

カテゴリ

質問済み:

2019 年 4 月 27 日

コメント済み:

dpb
2019 年 4 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by