i have a 42*16384. how do i average it so that i get a new matrix of size 42*2048 (if N=2048 represents one revolution and N=16384 represents 8 revolutions).

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 2 月 6 日

1 投票

data - your array [42x16384]
EDIT
out = mean(reshape(data,size(data,1),[],8),3);
eg:
data - your array [55x72000]
out = mean(reshape(data,size(data,1),[],3),3);
or
out = squeeze(mean(reshape(data,size(data,1),3,[]),2)) ;

5 件のコメント

Lisa Justin
Lisa Justin 2012 年 2 月 6 日
thanks. Please how do i do the same with a matrix of 55*72000 so i get 55*24000 (where N=24000 represents one revolution and N=72000 represents 3 revolutions)?
Andrei Bobrov
Andrei Bobrov 2012 年 2 月 6 日
out = mean(reshape(data.',size(data,2),[],3),3).'
Lisa Justin
Lisa Justin 2012 年 2 月 6 日
i get an error message
??? Error using ==> reshape
Product of known dimensions, 216000, not divisible into total number of elements,
3960000.
Lisa Justin
Lisa Justin 2012 年 2 月 6 日
I am still getting the same error message with
out = squeeze(mean(reshape(data.',size(data,2),8,[]),2)).'
Andrei Bobrov
Andrei Bobrov 2012 年 2 月 6 日
see EDIT

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

その他の回答 (0 件)

カテゴリ

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

タグ

質問済み:

2012 年 2 月 6 日

編集済み:

2013 年 10 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by