How do I pre-allocate memory for a complex matrix?
Mostrar comentarios más antiguos
I want to pre-allocate memory for a complex variable because the MATLAB documentation states that one should pre-allocate memory to speed up performance, i.e.
x = zeros(1000);
However, this only allocates the real-part. How do I pre-allocate a complex number? i.e.
x = zeros(1000) + j*zeros(1000);
This does not work. Instead it only allocates memory for the real part of the complex number array.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!