Effacer les filtres
Effacer les filtres

How do I preallocate symbolic matrix?

43 vues (au cours des 30 derniers jours)
Shawn Miller
Shawn Miller le 28 Fév 2016
Commenté : Hernán Moreno le 7 Juil 2021
I got the warning of preallocation when I tried to change the size of my 1*n symbolic array (elements are symbolic expressions) every time I added a new element. So I wonder how do I allocate symbolic array like zeros(n) in numeric array? Does zeros(m,n,'sym') or sym(zeros(m,n)) work or whatever really works and would increase speed?

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Fév 2016
sym(zeros(m,n)) is good and would increase your speed.
  1 commentaire
Hernán Moreno
Hernán Moreno le 7 Juil 2021
helpful, thanks :D

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by