Is there a faster way of updating elements in a big matrix?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Is there a faster way of updating elements in a big matrix?
Currently, I have A with a size of 9000000*8760. Each loop I need to update some elements, like: B=randi(800000,10000,1); A(B,:)=5;
Is there a faster way of dealing with big data?
Thank you.
1 comentario
dpb
el 5 de Jul. de 2018
Until run profiler to know where are slow spots specifically any micro optimization is premature.
W/o other information on code structure nothing to be said;
A(B,:)=5;
is about as efficient as it gets presuming elements of B are already in A which is a class double array...the hint may be in the earlier phrase of "Each loop...". Perhaps that loop or significant portions could be vectorized or otherwise are the bottleneck but crystal ball is in shop for repair (yet again)...
Respuestas (0)
Ver también
Categorías
Más información sobre Web Services 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!