how to perform Many to one mapping
조회 수: 4 (최근 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!