how to perform Many to one mapping
2 次查看(过去 30 天)
显示 更早的评论
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
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
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 个评论
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
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})
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!