Unfortunately, I'm pretty sure MATLAB has no good way to do what you want. You will either have to use a for loop to build a new array, or go back and reverse engineer your data structures. For example, you can use an array structure rather than an array structure.
source share