Why do functions in MATLAB 7.8 (R2009a) execute faster than methods of objects for the same computation?
1 view (last 30 days)
Show older comments
I observe that code placed in a method of a class executes slower than the same code placed in a regular MATLAB function.
Accepted Answer
MathWorks Support Team
on 4 Dec 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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!