1.

Do You Know How To Pre Allocate A Non Double Matrix?

Answer»

Preallocating a BLOCK of memory for holding a NON double matrix is memory EFFICIENT.

  •  It is faster to use the function 'repmat'.
  •  While allocating block of memory for a matrix, ZEROS are pre allocated to a matrix.
  •  The function to pre allocate memory is int8().
  • Ex: matrix = int8(zeros(100));
  •  Repmat function is used to create a single double matrix.
  •  Ex: matrix2 = repmat(int8(0), 100, 100);
  •  Thus non double matrix is pre allocated.

Preallocating a block of memory for holding a non double matrix is memory efficient.



Discussion

No Comment Found