why does it take forever to generate some matrices in the Matlab gallery?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Viviana Arrigoni
le 28 Jan 2019
Commenté : Viviana Arrigoni
le 1 Fév 2019
I interrupted the execution of
gallery('randcorr',n)
and
A = gallery('toeppd',n,n,rand(n,1),rand(n,1));
for n = 10000 after almost one hour. I know my computer is not the fastest, but for other matrices in the gallery, it would take seconds.
0 commentaires
Réponse acceptée
Matt J
le 28 Jan 2019
Modifié(e) : Matt J
le 28 Jan 2019
Because some of the matrix types in the gallery are computationally expensive to construct. In particular, in
A = gallery('toeppd',n,n,rand(n,1),rand(n,1));
you are asking for the summation of 10000 matrices, where each matrix is itself 10000 x 10000. That is a lot of number crunching.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!