Hello, For example I have two cell arrays x {10}(20x5) non integer values and k {10}(5x1) integer values 1:5, and use one cell array as index to other array.
x1=cellfun(@(x,y) x(5,y),x,k, 'UniformOutput',false);
and result is x1 {10}(1x5), unfortunately cell fun is slow with gpuArray when working with bigger arrays, what would be the way to use 3D arrays and maybe arrayfun for this?
1 Comment
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408407-how-to-change-cell-arrays-to-3d-arrays-in-order-to-speed-up-calculations#comment_585139
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/408407-how-to-change-cell-arrays-to-3d-arrays-in-order-to-speed-up-calculations#comment_585139
Sign in to comment.