|
I have some pretty simple seeming code, like this:
n = length(vec);
ord = bitrevorder(1:n);
vec = vec(ord);
It just puts e vector in bit reverse order.
Now I'm trying to convert to a MEX file using codegen and running into all sorts of trouble. First, of course, is that bitrevorder is not supported. But ignoring that, I keep getting errors about "mxarray indices are not supported". This seems to be preventing me from doing the most basic things. It's griping about the "vec = vec(ord)" line. I cannot believe that the coder won't support indexing into vectors, what am I missing?
Even writing it out like this breaks:
vec2 = vec;
for k = 1:n
vec(k) = vec2(ord(k));
end
There must be a way to reorder a vector according to a list of indices. Any help would be greatly appreciated!
|