How do I pre-allocate memory for a complex matrix?
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!