array indexing with repeated index, index size larger than the array
Show older comments
Hi
I want to do c = 1; for i = I B(c) = A(i); c = c + 1; end
where I is a vector.
For instance A = [a b c d]; I = [1 1 3 1 1 1 2 2 1]; then B = [a a c a a a b b a];
is there a fast way to do this without for loop?
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!