How to use Shuffle.c index mode for complex numbers
Show older comments
I want to shuffle a 3d array within the third dimension using Shuffle.c. Till now I have used Shuffle(arr,3) with great performance. Now I try to do the same, but with array of Complex numbers and get this Error:
*** Shuffle[mex]: Use index mode for complex input!
I haven't found the proper way to use index mode.
Thank you.
5 Comments
Walter Roberson
on 14 Apr 2020
When you compile the file into a .mex* file, add the option -r2017b option; https://www.mathworks.com/help/matlab/ref/mex.html#mw_5d9f5fd8-76a3-4406-817f-d4bba493eeb8
Sharon Yakim
on 14 Apr 2020
Edited: Sharon Yakim
on 14 Apr 2020
James Tursa
on 14 Apr 2020
What version of MATLAB are you using?
Sharon Yakim
on 15 Apr 2020
James Tursa
on 15 Apr 2020
Shuffling the new interleaved complex data directly in R2018a or later will require code changes. Fairly easy to do, but I don't know if Jan plans on these updates. If not, I could probably do it.
Accepted Answer
More Answers (1)
James Tursa
on 14 Apr 2020
Edited: James Tursa
on 14 Apr 2020
0 votes
Note: Compiling mex code in R2018a or later with the '-R2017b' option will cause the mex routine to make deep copies of all complex inputs & outputs. This may greatly negate any speed advantage that the mex routine may have had for these arguments. To gain that speed advantage back the mex source code may have to be rewritten to be compiled with '-R2018a' option.
3 Comments
Sharon Yakim
on 15 Apr 2020
Walter Roberson
on 15 Apr 2020
in this case, Jan's code is detecting complex and refusing to run, so any complex support would be an enhancement.
James Tursa
on 15 Apr 2020
I took a look at the code and yes it will need source code changes to operate properly in R2018a+. The changes would not be difficult to do, simply adding routines for 16-byte data types and some minor up-front changes. I dropped a note to Jan on the FEX to see if there are any update plans for this.
Categories
Find more on Matrix Indexing 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!