how to perform Many to one mapping

4 ビュー (過去 30 日間)
Jyothi Alugolu
Jyothi Alugolu 2017 年 3 月 20 日
コメント済み: Walter Roberson 2017 年 3 月 27 日
hello,
i am having a bit string (say 'a') of size 756*1...and another bit string (say b) of size 576*1...now, i want many to one mapping to be performed on this bit string..
for example: the operation to be performed is shown below
b(k)= a(j) j=1....756, k= j mod 576...
  1 件のコメント
Guillaume
Guillaume 2017 年 3 月 20 日
k cannot be j mod 576 as this would produce zero indices. k could be ((j-1) mod 576)+1

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 3 月 20 日
Afterwards, should b(1) be assigned the value of a(1), or should it be assigned the value of a(577) ?
  17 件のコメント
Jyothi Alugolu
Jyothi Alugolu 2017 年 3 月 27 日
Normally we have to apply FFT on binary string 'b' which is of double,but our generated binary string is of type cell..so,we used cell2mat function to convert input argument of type cell to double..but,there is a problem i.e., the cell with 2 values of generated binary string is being splitted (like if a cell(be 4) in 'b' has [0,1] values,then after using Cell2mat function the 4th cell is having 0 value and 5th cell is having 1 value)...but, i dont want these 2 values to be splitted...i want these 2 values to be within a cell to apply FFT..if it is not possible to apply FFT on this 'b' without using cell2mat function,can you please tell me how to overcome this problem...
Walter Roberson
Walter Roberson 2017 年 3 月 27 日
What you ask for is not possible. It is meaningless to apply fft to a many-to-one mapping.

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

その他の回答 (1 件)

Guillaume
Guillaume 2017 年 3 月 20 日
Is this what you're after? (I'm unclear on the result you want to obtain)
a = randi([0 1], 756, 1); %random demo data
b = randi([0 1], 576, 1); %does the content of b matter?
b = accumarray(mod(0:numel(a)-1, numel(b))'+1, a, [], @(bits) {bits})

カテゴリ

Help Center および File ExchangeOther Formats についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by