A=[1 2 4 6 9] B=[2 1 3 5] C=A(B)
C=[2 1 4 9]
How is matlab do this very fast is used the following code
for i=1 to 4 c(i)=A(B(i) end
I think no since it do this very fast even if the vector size is 100000 so how is matlab do this
I need the answer since I need to program it in C to become fast as in matlab please any help
I believe that these basic things are done just like you show, but in compiled C-code. Thus it is much faster that using interpreted MATLAB code, even with the JIT.