Why do functions in MATLAB 7.8 (R2009a) execute faster than methods of objects for the same computation?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I observe that code placed in a method of a class executes slower than the same code placed in a regular MATLAB function.
Réponse acceptée
MathWorks Support Team
le 4 Déc 2012
The ability to run methods of objects at the same speed as the functions is not available in MATLAB 7.8 (R2009a). This is because method calls and object property accesses have overhead which slow the execution of the class method call.
As a workaround, perform the operation in a normal function instead of in a object method call.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!