How to change cell arrays to 3D arrays in order to speed up calculations?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Guillaume
el 3 de Jul. de 2018
An example would be if
x(:,:,1)
1 8 10 2 5
3 5 7 9 11
4 5 2 3 7
12 10 4 6 2
9 7 10 1 3
.....
and k(:,:,1)
3
4
1
5
3
then x1(:,:1) would be
10 1 9 3 10
Ver también
Categorías
Más información sobre Data Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!